/* Tekmerion — coming soon. Self-contained. Fonts are local woff2 files. */

@font-face {
  font-family: "Cinzel";
  src: url("fonts/cinzel-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("fonts/cinzel-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-greek-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-greek-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

:root {
  --bg: #07090e;
  --bg-deep: #00060f;
  --navy: #002862;
  --paper: #f3efe6;
  --paper-dim: #c9c2b4;
  --muted: #8f8778;
  --gold: #c4a56a;
  --gold-soft: rgba(196, 165, 106, 0.85);
  --red: #e31c23;
  --line: rgba(196, 165, 106, 0.35);
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Calibri, system-ui, sans-serif;
  --display: "Cinzel", "Palatino Linotype", Palatino, serif;
  --greek-font: "EB Garamond", "Source Serif 4", "Times New Roman", serif;
  --pad: clamp(1.25rem, 4vw, 2.75rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--gold);
  text-decoration: none;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--paper); }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 20;
  background: var(--gold);
  color: var(--bg);
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}
.skip:focus { top: 0.75rem; }

.backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(7, 9, 14, 0.82) 0%, rgba(7, 9, 14, 0.2) 10%, rgba(7, 9, 14, 0.04) 22%, rgba(7, 9, 14, 0.04) 78%, rgba(7, 9, 14, 0.28) 90%, rgba(7, 9, 14, 0.92) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.03;
  mix-blend-mode: screen;
  background-image: url("film.png");
  background-size: 160px 160px;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 3;
}

.site-header {
  display: flex;
  align-items: center;
  padding: calc(var(--pad) * 0.7) var(--pad) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--paper);
  text-decoration: none;
}
.brand:hover { color: var(--paper); }
.brand img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.45rem;
}
.brand-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  line-height: 1;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  text-align: center;
  padding: clamp(1.5rem, 6vh, 3.5rem) var(--pad) 0;
  max-width: 46rem;
  margin: 0 auto;
}

.kicker {
  margin: 0 0 1.15rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(7, 9, 14, 1), 0 0 10px rgba(7, 9, 14, 1), 0 1px 8px rgba(7, 9, 14, 0.95);
}

h1 .line { display: block; }

h1 {
  margin: 0 0 1.35rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.05rem, 5.2vw + 0.55rem, 4.85rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--paper);
  text-wrap: balance;
  text-shadow: 0 0 36px rgba(7, 9, 14, 0.85), 0 2px 18px rgba(7, 9, 14, 0.7);
}

.lede {
  margin: 0 auto 1.5rem;
  max-width: 34rem;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.65;
  color: var(--paper-dim);
  text-wrap: pretty;
  text-shadow: 0 0 22px rgba(7, 9, 14, 0.95), 0 1px 16px rgba(7, 9, 14, 0.9);
}

.etymology {
  margin: 0 auto 2rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--muted);
  font-style: italic;
  text-shadow: 0 1px 14px rgba(7, 9, 14, 0.9);
}
.etymology .greek {
  font-family: var(--greek-font);
  font-style: italic;
  font-size: 1.22em;
  color: var(--paper);
  letter-spacing: 0.02em;
}
.etymology .sep {
  font-style: normal;
  color: var(--gold);
  padding: 0 0.15em;
}

.cta {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cta:hover {
  background: rgba(196, 165, 106, 0.12);
  color: var(--paper);
  border-color: var(--gold-soft);
}

.meander {
  display: flex;
  justify-content: center;
  margin: clamp(2rem, 6vh, 3.25rem) auto 0;
  opacity: 0.9;
}
.meander svg {
  width: min(13.5rem, 58vw);
  height: auto;
  display: block;
}

.promise {
  text-align: center;
  padding: 1.6rem var(--pad) 0.5rem;
  max-width: 40rem;
  margin: 0 auto;
}

.promise-lead {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.45;
  color: var(--paper);
  text-wrap: pretty;
}

.modalities,
.fields {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c1baab;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(7, 9, 14, 0.95);
}
.fields { margin-top: 0.15rem; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 1.75rem var(--pad) calc(1.5rem + env(safe-area-inset-bottom));
  max-width: 70rem;
  margin: 0 auto;
  width: 100%;
}

.founder {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.portrait {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 1px solid var(--line);
  flex: none;
}

.founder-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--paper);
}
.founder-role {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.footer-meta {
  flex: 1 1 16rem;
  min-width: 0;
}
.footer-meta p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}
.footer-meta strong {
  font-weight: 600;
  color: var(--paper-dim);
}
.disclaimer { margin-top: 0.25rem !important; }
.footer-contact { margin-top: 0.45rem !important; }
.footer-contact a { color: var(--gold-soft); }
.footer-contact a:hover { color: var(--paper); }
.footer-contact .dot {
  margin: 0 0.55rem;
  color: var(--muted);
}
.nowrap { white-space: nowrap; }

.plate { display: none; }
.cta-icon { display: none; }

.site-header {
  padding-top: calc(var(--pad) * 0.7 + env(safe-area-inset-top));
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  :root { --pad: 1.375rem; }

  body { font-size: 1rem; }

  .site-header { padding-top: calc(0.9rem + env(safe-area-inset-top)); }
  .brand { gap: 0.7rem; }
  .brand img { width: 2.4rem; height: 2.4rem; }
  .brand-name { font-size: 0.82rem; letter-spacing: 0.3em; color: var(--paper); }

  /* The scan field becomes a framed plate above the headline (drawn by field.js). */
  .veil {
    background: linear-gradient(to bottom, rgba(7, 9, 14, 0.7) 0%, rgba(7, 9, 14, 0) 7%, rgba(7, 9, 14, 0) 100%);
  }
  .backdrop {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
  }

  main { flex: 0 0 auto; justify-content: flex-start; }

  .hero {
    padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
    width: 100%;
    max-width: 34rem;
  }

  .plate {
    display: block;
    width: min(calc(100% + 2 * var(--pad)), 27rem);
    aspect-ratio: 1 / 0.93;
    margin: 0.35rem auto 0.6rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }

  .kicker {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    letter-spacing: 0.44em;
    padding-left: 0.44em; /* optically re-centre tracked caps */
  }

  h1 {
    margin: 0 0 1.25rem;
    font-weight: 600;
    font-size: clamp(2.6rem, 12.4vw, 3.45rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-shadow: none;
  }
  h1 .br { display: block; }

  .lede {
    margin: 0 auto 1.35rem;
    font-size: 1.0625rem;
    line-height: 1.62;
    color: #ddd6c8;
    text-shadow: none;
    text-wrap: balance;
  }

  .etymology {
    margin: 0 auto 1.75rem;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: #b5ac9b;
    text-shadow: none;
    text-wrap: balance;
  }
  .etymology .greek { font-size: 1.25em; }

  .cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    max-width: 21rem;
    min-height: 3.35rem;
    padding: 0.85rem 1.4rem;
    border: 1px solid rgba(232, 208, 156, 0.75);
    border-radius: 999px;
    background: linear-gradient(180deg, #dcc18b 0%, #c4a56a 55%, #ad8c52 100%);
    color: #0b0d12;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 30px -10px rgba(196, 165, 106, 0.55), inset 0 1px 0 rgba(255, 245, 220, 0.55);
  }
  .cta:hover, .cta:active {
    background: linear-gradient(180deg, #e6cd9a 0%, #cfb077 55%, #b8975c 100%);
    color: #0b0d12;
  }
  .cta-icon { display: block; flex: none; }

  .meander { margin: 2.5rem auto 0; }
  .meander svg { width: min(12rem, 56vw); }

  .promise { padding: 1.5rem max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left)); }
  .promise-lead {
    margin: 0 0 1.35rem;
    font-size: 1.2rem;
    line-height: 1.45;
    text-wrap: balance;
  }
  .modalities,
  .fields {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.45rem;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-shadow: none;
  }
  .modalities .dot, .fields .dot { display: none; }
  .chip {
    display: inline-block;
    padding: 0.42rem 0.7rem 0.4rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
  }
  .modalities .chip {
    color: #ece6da;
    border: 1px solid rgba(196, 165, 106, 0.45);
    background: rgba(196, 165, 106, 0.08);
  }
  .fields { margin-top: 0.6rem; }
  .fields .chip {
    color: #c9c1b1;
    border: 1px solid rgba(243, 239, 230, 0.16);
    background: rgba(243, 239, 230, 0.03);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    margin-top: 2.75rem;
    padding: 1.6rem max(var(--pad), env(safe-area-inset-right)) calc(1.75rem + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
    border-top: 1px solid rgba(196, 165, 106, 0.22);
    background: linear-gradient(to bottom, rgba(196, 165, 106, 0.035), rgba(196, 165, 106, 0));
  }
  .portrait { width: 3.5rem; height: 3.5rem; }
  .founder-name { font-size: 1.1rem; }
  .founder-role { font-size: 0.9375rem; color: #b5ac9b; letter-spacing: 0.01em; }
  .footer-meta { flex: none; width: 100%; }
  .footer-meta p { font-size: 0.9375rem; line-height: 1.55; color: #aaa192; }
  .footer-meta strong { color: #ddd6c8; }
  .disclaimer { margin-top: 0.5rem !important; }
  .footer-contact { margin-top: 0.75rem !important; }
  .footer-contact a { font-size: 1rem; font-weight: 600; color: var(--gold); }
}

@media (max-height: 920px) and (min-width: 800px) {
  h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); margin-bottom: 0.9rem; }
  .hero { padding-top: 0.85rem; }
  .kicker { margin-bottom: 0.9rem; }
  .lede { margin-bottom: 0.9rem; }
  .etymology { margin-bottom: 1.1rem; }
  .meander { margin-top: 1.25rem; }
  .promise { padding-top: 1.15rem; padding-bottom: 0.2rem; }
  .promise-lead { margin-bottom: 0.85rem; }
  .site-footer { padding-top: 1.15rem; padding-bottom: 1.1rem; }
}
