/* SMI IT Solutions Inc. — site styles
   Colours and fonts live in :root so they are easy to change.
   Dark mode follows the system setting until the visitor picks one (html[data-theme]). */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #000000;
  --gold: #c9a227;
  --line: rgba(0, 0, 0, .15);
  --line-strong: rgba(0, 0, 0, .25);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
  --mono: 'Space Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --ease: cubic-bezier(.6, .05, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --ink: #f2f2f2;
    --line: rgba(255, 255, 255, .16);
    --line-strong: rgba(255, 255, 255, .28);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --ink: #f2f2f2;
  --line: rgba(255, 255, 255, .16);
  --line-strong: rgba(255, 255, 255, .28);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }

/* Page background animation (js/main.js → CONFIG.background) */
.bg-canvas { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* Dot map / World map: hub city labels (placed by js/main.js) */
.map-labels { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.map-labels[hidden] { display: none; }
.map-label {
  position: absolute; top: 0; left: 0; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--line-strong);
}

/* Header background — fades in as the logo docks */
.header-bg {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  height: 112px; overflow: hidden; opacity: 0;
  background: var(--bg);
}
.header-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Logos */
.logo { position: fixed; top: 0; left: 0; z-index: 3; display: block; }
.logo svg { display: block; width: 100%; height: auto; overflow: visible; }
.ink { stroke: var(--ink); }
.gold { stroke: var(--gold); }

.hero { transform-origin: 0 0; }
.stroke {
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: draw 2.6s var(--ease) .2s both, fadeIn 1.6s ease-out .2s both;
}
.tagline {
  margin-top: calc(15px - 1.86%); text-align: center; /* the viewBox has 1.86% (of the width) of space under the strokes */
  font-family: var(--mono); font-size: clamp(14px, 3.6vw, 22px);
  letter-spacing: .35em; padding-left: .35em;
  animation: type .9s steps(15, end) 2.9s both, fadeIn .9s ease-out 2.9s both;
}
.hero.replay-reset .stroke, .hero.replay-reset .tagline { animation: none; }


.dock { z-index: 4; pointer-events: none; } /* above the masthead nav, which spans the header behind it */
.dstroke { stroke-dasharray: 1; stroke-dashoffset: .999; opacity: 0; }
.dock.in { pointer-events: auto; }
.dock.in .dstroke { animation: draw 1.4s var(--ease) both, fadeIn 1s ease-out both; }
.dock.out .dstroke { animation: undraw .8s var(--ease) both, fadeOut .8s ease-in both; }

/* Nav */
.nav {
  position: fixed; top: 34px; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 4px 14px;
  font-family: var(--mono); font-size: 15px; letter-spacing: .18em; text-transform: uppercase;
  opacity: 0;
}
.nav:focus-within { opacity: 1 !important; }
.sep { opacity: .4; }
/* Masthead (CONFIG.headerLayout): the logo docks in the gap between Work and About */
.nav.split .sep { display: none; }
.nav.split a:nth-of-type(2) { margin-right: auto; }
.link { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.link::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 8px; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.link:hover::after, .link:focus-visible::after, .link[aria-current]::after { transform: scaleX(1); }
.link[aria-current] { color: var(--gold); } /* the section you're in (home) or Work (case studies) */

/* Animations + theme toggles: beside the menu, bottom-right on phones (placed by js/main.js) */
.controls { position: fixed; z-index: 4; display: flex; align-items: center; gap: 8px; height: 44px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .sun, .theme-btn[data-mode="dark"] .moon { display: none; }
.theme-btn[data-mode="dark"] .sun { display: block; }
.motion-btn .still, .motion-btn[data-mode="off"] .waves { display: none; }
.motion-btn[data-mode="off"] .still { display: block; }

/* Hero space + scroll cue */
.hero-space { position: relative; z-index: 1; height: 100vh; }
.cue {
  position: absolute; left: 0; right: 0; bottom: 36px; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .3em;
}
.cue-in { display: inline-block; animation: fadeIn .6s ease 3.6s both; } /* on the inner span: .cue's opacity is the scroll fade (js) */
.cue-arrow { display: inline-block; color: var(--gold); animation: bob 1.6s ease-in-out 4.2s infinite; }

/* Content */
.content { position: relative; z-index: 1; }

main {
  position: relative; max-width: 1120px; margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px) 64px;
  display: flex; flex-direction: column; gap: 160px;
}
.sec { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 130px; }
#work { gap: 28px; }
/* Frosted panel behind each section so the background never runs through the text (off when the background is None) */
:root:not([data-bg="None"]) .sec {
  --frost: clamp(14px, 3vw, 40px);
  margin-inline: calc(-1 * var(--frost)); padding: var(--frost);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
:root:not([data-bg="None"]) .sec .tile { background: transparent; }
.eyebrow { margin: 0; font-family: var(--mono); font-size: 14px; font-weight: 400; letter-spacing: .3em; }
.mark { color: var(--gold); }
.lead { margin: 0; font-size: clamp(30px, 4.4vw, 56px); font-weight: 500; line-height: 1.08; letter-spacing: -.02em; max-width: 20ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; }
.card { border-top: 2px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 24px; font-weight: 500; }
.meta { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .12em; opacity: .7; }
.about { margin: 0; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.35; max-width: 34ch; }
.email { align-self: flex-start; font-size: clamp(22px, 2.6vw, 32px); font-weight: 500; padding: 0; }

/* Contact form (js/main.js posts it to api/contact) */
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; max-width: 760px; margin-bottom: 12px; }
.contact-form .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 0;
  background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field [aria-invalid="true"] { border-color: var(--ink); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.send {
  font-family: var(--mono); font-size: 13px; letter-spacing: .2em; min-height: 44px; padding: 0 28px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--bg); cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.send:hover, .send:focus-visible { background: transparent; border-color: var(--gold); color: var(--gold); outline: none; }
.send:disabled { opacity: .5; cursor: default; }
.form-status { margin: 0; font-size: 15px; }
@media (max-width: 639px) { .contact-form { grid-template-columns: 1fr; } }
.num { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; color: var(--gold); }
.tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px;
}

/* Services: numbered rows */
.services { margin: 12px 0 0; padding: 0; list-style: none; }
.service {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 300px); gap: 12px 24px;
  align-items: start; padding: 24px 0; border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service .num { padding-top: 6px; }
.service h3 { margin: 0 0 6px; font-size: 24px; font-weight: 500; }
.service p { margin: 0; line-height: 1.5; max-width: 52ch; }
.service .tags { padding-top: 4px; }

/* Industries: tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.tile { border: 1.5px solid var(--ink); padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.tile h3 { margin: 0; font-size: 22px; font-weight: 500; }
.tile ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
.tile a { font-weight: 600; transition: color .2s; }

/* Work: case-study cards + smaller anonymised projects */
a.card { transition: border-color .3s; }
a.card:hover { color: inherit; border-top-color: var(--gold); }
.card p:not(.meta) { margin: 0; line-height: 1.5; }
.more { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .15em; }
a.card:hover .more { color: var(--gold); }
.subhead { margin: 32px 0 0; font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.minis { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; }
.mini { border-top: 1px solid var(--line-strong); padding-top: 12px; }
.mini p { margin: 0; line-height: 1.45; }
.mini .meta { margin-bottom: 6px; }

/* About: process steps */
.steps { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 12px 40px; font-family: var(--mono); font-size: 15px; letter-spacing: .15em; text-transform: uppercase; }
.steps .num { margin-right: 8px; }

/* Case-study pages */
body[data-page="inner"] main { padding-top: 168px; gap: 96px; }
.back { align-self: flex-start; font-family: var(--mono); font-size: 13px; letter-spacing: .15em; margin-bottom: 24px; }
.intro { margin: 0; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4; max-width: 40ch; }
.facts { margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 24px; }
.facts div { border-top: 1px solid var(--line-strong); padding-top: 10px; }
.facts dt { font-family: var(--mono); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; opacity: .7; }
.facts dd { margin: 4px 0 0; }
.prose { max-width: 68ch; font-size: 18px; line-height: 1.6; }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.stat { border-left: 3px solid var(--gold); padding-left: 24px; }
.stat strong { display: block; font-size: clamp(48px, 7vw, 88px); font-weight: 500; line-height: 1; letter-spacing: -.03em; }
.stat span { display: block; margin-top: 8px; font-size: 18px; max-width: 40ch; }
.next { border-top: 2px solid var(--ink); padding-top: 16px; }
.next a { font-size: clamp(24px, 3vw, 36px); font-weight: 500; }
.next .meta { margin-bottom: 4px; }

@media (max-width: 720px) {
  .service { grid-template-columns: 36px minmax(0, 1fr); }
  .service .tags { grid-column: 2; }
}
@media (max-width: 639px) {
  .nav .sep { display: none; }
  body[data-page="inner"] main { padding-top: 120px; }
  .controls .icon-btn { box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
}

footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .2em; opacity: .8;
}
.replay {
  font: inherit; letter-spacing: .12em; min-height: 44px; padding: 0 18px;
  border: 1.5px solid currentColor; border-radius: 999px; background: transparent; color: inherit; cursor: pointer;
}

/* Sections slide up as they scroll into view (where supported) */
@supports (animation-timeline: view()) {
  .sec { animation: secIn linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
}

@keyframes draw { from { stroke-dashoffset: .999; } to { stroke-dashoffset: 0; } }
@keyframes undraw { from { stroke-dashoffset: 0; } to { stroke-dashoffset: .999; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes secIn { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }

/* Animations off: the system setting unless the visitor chose (html[data-motion], the toggle by the menu) */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) :is(.stroke, .tagline, .cue-in, .cue-arrow, .sec, .dstroke) { animation: none !important; }
  :root:not([data-motion="on"]) .dock.in .dstroke { opacity: 1; stroke-dashoffset: 0; }
}
:root[data-motion="off"] :is(.stroke, .tagline, .cue-in, .cue-arrow, .sec, .dstroke) { animation: none !important; }
:root[data-motion="off"] .dock.in .dstroke { opacity: 1; stroke-dashoffset: 0; }
