/* =====================================================================
   Fije — fije.it
   Plain static CSS, no build step. Design tokens from ../brand/palette.
   Type: Fraunces (display) + Hanken Grotesk (text), self-hosted.
   ===================================================================== */

/* ---------- Fonts (variable, latin subset) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url(../fonts/fraunces-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url(../fonts/hanken-grotesk-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper:      #FAF8FC;
  --surface:    #FFFFFF;
  --ink:        #241F2A;
  --muted:      #6B6674;
  --line:       #D9D5DE;
  --tint:       #E7E2F2;   /* lilac 100 */
  --brand:      #8B7EB8;   /* lilac 500 — mark, large accents, thread */
  --brand-ink:  #6A5D96;   /* lilac 700 — links, CTA on light (AA) */
  --accent:     #D67DA8;   /* pink 500 — decorative only, used once */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 42rem;          /* text column */
  --shell: 68rem;            /* outer container */
  --header-h: 4rem;

  --space-section: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 14px;

  --shadow: 0 1px 2px rgba(36, 31, 42, .04), 0 8px 30px rgba(36, 31, 42, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #1E1A24;
    --surface:   #262030;
    --ink:       #F3F0F8;
    --muted:     #A8A2B4;
    --line:      #3A3442;
    --tint:      #2E2740;
    --brand:     #A99BD6;
    --brand-ink: #C3B9E2;   /* lilac ~300, AA on dark */
    --accent:    #D98FB4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 34px rgba(0, 0, 0, .35);
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--brand-ink); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
h1 { letter-spacing: -.02em; }
strong { font-weight: 700; }
::selection { background: var(--tint); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Layout ---------- */
.container { max-width: var(--shell); margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 2.5rem); }
.measure { max-width: var(--measure); }

.section { padding-block: var(--space-section); border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

.eyebrow {
  font-family: var(--font-text);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 1.5rem; height: 2px;
  background: var(--brand);
  display: inline-block;
}
.section > .container > h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  margin: 0 0 1rem;
  max-width: var(--measure);
}
.lede { font-size: 1.125rem; color: var(--muted); max-width: var(--measure); margin: 0 0 2.5rem; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); color: var(--ink);
  padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow); }
.site-header .container {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 1.25rem;
  transition: min-height .2s ease;
}
.site-header.is-scrolled .container { min-height: calc(var(--header-h) - .9rem); }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.3rem; letter-spacing: -.01em;
  transition: font-size .2s ease;
}
.brand-mark { height: 1.6rem; width: auto; color: var(--brand); flex: none; transition: height .2s ease; }
.site-header.is-scrolled .brand { font-size: 1.1rem; }
.site-header.is-scrolled .brand-mark { height: 1.3rem; }
.brand:hover { text-decoration: none; }

.nav-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 1.1rem; height: 1.1rem; }
.nav-toggle .icon-close { display: none; }
body.nav-open .nav-toggle .icon-open { display: none; }
body.nav-open .nav-toggle .icon-close { display: block; }

#site-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.6rem;
}
#site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 1.6rem;
}
#site-nav a {
  color: var(--ink); text-decoration: none; font-size: .95rem;
  padding-block: .3rem;
}
#site-nav a:hover { color: var(--brand-ink); }
.lang-switch {
  display: flex; gap: .5rem; align-items: center;
  font-size: .9rem; color: var(--muted);
  padding-left: 1.4rem; border-left: 1px solid var(--line);
}
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current="true"] { color: var(--ink); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-text); font-weight: 600; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 10px;
  text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary {
  background: var(--brand-ink); color: #fff;
  border: 1.5px solid var(--brand-ink);
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #1E1A24; }
  .btn-primary:hover { background: var(--ink); border-color: var(--ink); color: #1E1A24; }
}
.btn-ghost {
  background: transparent; color: var(--brand-ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--brand-ink); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 10vw, 7rem); }
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.15rem, 5.6vw, 3.5rem);
  margin: 0 0 1.2rem;
  max-width: 20ch;
}
.hero p { max-width: 46ch; margin: 0 0 1rem; font-size: 1.15rem; }
.hero .sub { color: var(--muted); font-size: 1rem; }
.hero .cta-row { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: .8rem; }

.thread {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  color: var(--brand);
  pointer-events: none;
  z-index: 0;
}
.thread path { stroke: currentColor; fill: none; }
.hero .thread { opacity: .5; }

/* ---------- Services ---------- */
.cards {
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 1.8rem);
}
.card .card-id {
  font-family: var(--font-display); font-weight: 600;
  color: var(--brand); font-size: 1.05rem;
  display: block; margin-bottom: .35rem;
}
.card h3 {
  font-family: var(--font-text); font-weight: 700; font-size: 1.1rem; margin: 0 0 .9rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .6rem;
}
.card .badge {
  display: inline-block; font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--tint);
  padding: .2rem .5rem; border-radius: 999px;
  white-space: nowrap;
}
.card dl { margin: 0; display: grid; gap: .7rem; }
.card dt {
  font-size: .74rem; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.card dd { margin: .1rem 0 0; }

.beyond {
  margin-top: 1.6rem;
  background: var(--tint);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 1.3rem 1.4rem;
  max-width: var(--measure);
}
.beyond strong { display: block; margin-bottom: .3rem; }

/* ---------- Approach ---------- */
.approach { background: var(--surface); }
.steps {
  position: relative;
  display: grid; gap: 1.6rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
}
.step .num {
  font-family: var(--font-display); font-weight: 600;
  color: var(--brand); font-size: 1.2rem;
}
.step h3 { font-family: var(--font-text); font-weight: 700; font-size: 1.15rem; margin: .2rem 0 .4rem; }
.step p { margin: 0; color: var(--muted); }
.steps .thread-line { display: none; }

/* ---------- Why ---------- */
.why-grid {
  display: grid; gap: 1.4rem 2.2rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
}
.why-item h3 { font-family: var(--font-text); font-weight: 700; font-size: 1.08rem; margin: 0 0 .4rem; }
.why-item p { margin: 0; }
.why-item.track { }
.why-item.track p { color: var(--muted); }
.why-item.not {
  border-left: 3px solid var(--line);
  padding-left: 1.1rem;
}
.why-item.not h3 { color: var(--muted); }

/* ---------- Name ---------- */
.name-section { position: relative; overflow: hidden; }
.name-section .container { position: relative; z-index: 1; }
.name-section p { max-width: var(--measure); }
.name-section .thread { opacity: .22; }

/* ---------- Contact ---------- */
.contact h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.contact p { max-width: 44ch; font-size: 1.1rem; }
.contact-links {
  margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .8rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.2rem 3rem;
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; align-items: baseline; }
.site-footer .foot-brand {
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: 1rem; margin-right: .5rem;
}
.site-footer p { margin: 0; }

/* ---------- Contact bar (persistent slim footer while scrolling) ---------- */
.contact-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-top: 1px solid var(--line);
  transform: translateY(100%);
  transition: transform .25s ease;
}
.contact-bar.is-visible { transform: translateY(0); }
body.nav-open .contact-bar { display: none; }
.contact-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .65rem;
}
.contact-bar-brand {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: .95rem;
}
.contact-bar-brand svg { height: 1.05rem; width: auto; color: var(--brand); }
.contact-bar a {
  color: var(--brand-ink); text-decoration: none; font-weight: 600; font-size: .95rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.contact-bar a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 60rem) {
  #site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: .5rem clamp(1.25rem, 5vw, 2.5rem) 1.2rem;
    box-shadow: var(--shadow);
    display: none;
  }
  body.nav-open #site-nav { display: flex; }
  #site-nav ul { flex-direction: column; gap: 0; }
  #site-nav ul li { border-top: 1px solid var(--line); }
  #site-nav ul li:first-child { border-top: 0; }
  #site-nav a { display: block; padding: .85rem 0; }
  .lang-switch { padding: .9rem 0 0; border-left: 0; border-top: 1px solid var(--line); margin-top: .3rem; }
}

@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .why-item.track { grid-column: 1 / -1; }
  .why-item.not { grid-column: 1 / -1; }
}

@media (min-width: 60rem) {
  :root { --header-h: 4.5rem; }
  .nav-toggle { display: none; }
  #site-nav { display: flex; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
  .steps .thread-line {
    display: block;
    position: absolute; left: 0; right: 0; top: 1.1rem;
    height: 40px; color: var(--brand); opacity: .55;
    z-index: 0;
  }
  .step { position: relative; z-index: 1; }
}

@media (min-width: 72rem) {
  .why-item.track { grid-column: auto; }
}
