/* ============================================================
   TINKODER — styles.css
   Design system: "Nordic workshop"
   - Spruce green + birch paper, one amber signal colour
   - Display: Bricolage Grotesque · Body: Instrument Sans
   - Utility/spec labels: Spline Sans Mono (CAD-drawing motif)
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Colour — light theme (default) */
  --bg:        #F6F7F4;   /* birch paper */
  --surface:   #FFFFFF;
  --surface-2: #EDF0EB;
  --ink:       #182420;   /* spruce-black */
  --muted:     #57675F;
  --line:      #E1E6DF;
  --primary:   #1B5E4A;   /* spruce */
  --primary-ink:#0F3A2D;
  --on-primary:#F2F7F4;
  --accent:    #E9A13B;   /* signal amber — used sparingly */
  --focus:     #1B5E4A;

  /* Type */
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-body:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SF Mono", monospace;

  /* Shape & depth */
  --radius-s: 10px;
  --radius:   18px;
  --radius-l: 26px;
  --shadow-s: 0 1px 2px rgba(24,36,32,.05), 0 2px 8px rgba(24,36,32,.05);
  --shadow-m: 0 2px 6px rgba(24,36,32,.06), 0 12px 32px rgba(24,36,32,.08);

  /* Rhythm */
  --space-section: clamp(4.5rem, 10vw, 8rem);
  --container: 1120px;
}

[data-theme="dark"] {
  --bg:        #0F1513;
  --surface:   #17201C;
  --surface-2: #1D2823;
  --ink:       #E8EEE9;
  --muted:     #9DB0A6;
  --line:      #263229;
  --primary:   #5CB894;   /* spruce, lifted for dark contrast */
  --primary-ink:#8FD9BB;
  --on-primary:#0E1A15;
  --accent:    #E9A13B;
  --focus:     #5CB894;
  --shadow-s: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
  --shadow-m: 0 2px 6px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--primary); color: var(--on-primary); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p  { margin: 0 0 1em; }
.lead { font-size: clamp(1.15rem, 2vw, 1.3rem); color: var(--muted); max-width: 38em; }

.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: var(--space-section); }
.section--tint { background: var(--surface-2); }

/* CAD-style eyebrow label — the site's structural signature */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: .7em;
  margin-bottom: 1rem;
}
/* Dimension line with end ticks — like a CAD measurement callout */
.eyebrow::before, .eyebrow::after {
  content: "";
  width: 2.2em; height: 7px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}
.eyebrow::before { border-left: 1px solid currentColor; }
.eyebrow::after  { border-right: 1px solid currentColor; }

/* Spec chip — mono microlabel used on cards */
.spec {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28em .8em;
  display: inline-block;
}

/* ---------- 3. Header / navigation ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4.25rem;
}
.nav__logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.nav__logo svg { width: 30px; height: 30px; }
.nav__links { display: flex; gap: 1.4rem; margin-left: auto; list-style: none; padding: 0; }
.nav__links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; padding: .4em 0; border-bottom: 2px solid transparent; }
.nav__links a:hover, .nav__links a[aria-current="page"] { border-bottom-color: var(--primary); color: var(--primary); }
.nav__actions { display: flex; align-items: center; gap: .6rem; }

.lang-switch {
  font-family: var(--font-mono); font-size: .8rem;
  border: 1px solid var(--line); border-radius: 999px;
  display: inline-flex; overflow: hidden;
}
.lang-switch a, .lang-switch span {
  padding: .35em .8em; text-decoration: none; color: var(--muted);
}
.lang-switch [aria-current="true"] { background: var(--primary); color: var(--on-primary); }

.theme-toggle {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 999px;
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
/* Show moon in light mode, sun in dark mode */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav__burger {
  display: none;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-s); width: 2.6rem; height: 2.6rem;
  cursor: pointer; color: var(--ink);
}

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  border-radius: 999px; padding: .8em 1.6em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-s); }
.btn--primary:hover { background: var(--primary-ink); color: var(--on-primary); transform: translateY(-1px); box-shadow: var(--shadow-m); }
[data-theme="dark"] .btn--primary:hover { background: var(--primary-ink); color: var(--on-primary); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 5. Hero ---------- */
.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__note { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.hero__art { position: relative; }
.hero h1 .accent { color: var(--primary); }

/* ---------- 6. Cards & grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-s);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
  display: grid; place-items: center; margin-bottom: 1.1rem;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .98rem; margin-bottom: .8rem; }
.card .specs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; }
.card--link { text-decoration: none; color: inherit; display: flex; flex-direction: column; }

/* ---------- 7. Process (numbered — a real sequence) ---------- */
.process { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.process__step { position: relative; padding: 1.6rem 1.4rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.process__step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--accent); letter-spacing: .1em;
  display: block; margin-bottom: .6rem;
}
.process__step h3 { font-size: 1.1rem; }
.process__step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- 8. Portfolio ---------- */
.project { display: grid; grid-template-columns: 1fr 1fr; gap: 0; overflow: hidden; }
.project__media { background: var(--surface-2); display: grid; place-items: center; min-height: 260px; padding: 2rem; }
.project__body { padding: 2rem; display: flex; flex-direction: column; gap: .5rem; }
.project__facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; font-size: .95rem; margin: .6rem 0; }
.project__facts dt { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); padding-top: .2em; }
.project__facts dd { margin: 0; color: var(--muted); }

/* ---------- 9. FAQ ---------- */
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); margin-bottom: .7rem;
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 1rem 1.2rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--primary); font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 1.2rem 1.1rem; color: var(--muted); margin: 0; }

/* ---------- 10. Testimonials ---------- */
.quote { display: flex; flex-direction: column; gap: 1rem; }
.quote blockquote { margin: 0; font-size: 1.05rem; }
.quote figcaption { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); letter-spacing: .05em; }

/* ---------- 11. CTA band ---------- */
.cta-band {
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--radius-l);
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: inherit; }
.cta-band p { opacity: .85; max-width: 34em; margin-inline: auto; }
.cta-band .btn--light { background: var(--on-primary); color: var(--primary-ink); }
[data-theme="dark"] .cta-band .btn--light { color: #0F3A2D; }
.cta-band .btn--light:hover { transform: translateY(-1px); box-shadow: var(--shadow-m); }

/* ---------- 12. Forms ---------- */
.form { display: grid; gap: 1.1rem; }
.form label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: .35rem; }
.form input, .form textarea, .form select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .75em 1em;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.form .hint { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.form__status { font-weight: 600; color: var(--primary); }

/* ---------- 13. Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 3.5rem 2rem; background: var(--surface-2); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer h4 { font-size: .95rem; margin-bottom: .8rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--primary); text-decoration: underline; }
.footer__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1.5rem; }

/* ---------- 14. Page hero (subpages) ---------- */
.page-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-hero .lead { margin-top: .4rem; }

/* Service detail blocks */
.service-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; padding-block: 2.5rem; border-top: 1px solid var(--line); }
.service-detail:first-of-type { border-top: 0; }
.service-detail h3 { font-size: 1.5rem; }
.service-detail ul { color: var(--muted); padding-left: 1.2em; margin: .3em 0 1em; }
.service-detail li { margin-bottom: .3em; }

/* Prose (privacy, about) */
.prose { max-width: 46em; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose ul { color: var(--muted); }

/* ---------- 15. Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .project, .service-detail { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }

  /* Mobile navigation */
  .nav__burger { display: grid; place-items: center; margin-left: auto; }
  .nav__links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1rem; margin: 0;
    box-shadow: var(--shadow-m);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { display: block; padding: .8em 0; border-bottom: 1px solid var(--line); }
  .nav__links li:last-child a { border-bottom: 0; }
  .nav__actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .grid--3, .grid--2, .process { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- 16. Utilities ---------- */
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.mt-2 { margin-top: 2rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--primary); color: var(--on-primary);
  padding: .6em 1em; border-radius: var(--radius-s); z-index: 100;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }
