/* Two Minds site styles. Own palette. Fonts are self-hosted (SIL OFL, licences in assets/fonts/):
   no third-party requests. */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("fonts/fraunces-latin.woff2") format("woff2");
  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: "Fraunces"; font-style: italic; font-weight: 300 600; font-display: swap;
  src: url("fonts/fraunces-italic-latin.woff2") format("woff2");
  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: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  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;
}
:root {
  --bg: #0b0a10;
  --bg-2: #13111a;
  --ink: #efe8dd;
  --muted: #a8a196;
  --line: rgba(239, 232, 221, 0.14);
  --accent: #ffa868;      /* the one accent colour: warm, the human side */
  --warm: #ff9a5c;        /* particle colour, human mind */
  --cool: #62d0e6;        /* particle colour, machine mind */
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 12px; }

/* Particle field sits behind everything. */
#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  display: block;
}

/* ---------- Header ---------- */
.top {
  position: fixed; z-index: 20;
  top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; font-family: var(--serif); font-size: 21px; letter-spacing: 0.01em;
}
.brand-mark { display: block; width: 30px; height: 26.4px; flex: none; color: var(--ink); }
.top-right { display: flex; align-items: center; gap: 18px; }
.lang { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lang a { text-decoration: none; padding: 6px 4px; }
.lang a[aria-current="true"] { color: var(--ink); }
.lang a:hover { color: var(--ink); }

/* Rotating circular Menu badge */
.menu-badge {
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(11, 10, 16, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--ink); cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.menu-badge svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.menu-badge text { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0; text-transform: uppercase; fill: var(--ink); }
.menu-badge .core { display: grid; gap: 5px; }
.menu-badge .core span { display: block; width: 18px; height: 1.5px; background: var(--ink); transition: transform .3s ease, opacity .3s ease; }
.menu-badge[aria-expanded="true"] .core span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-badge[aria-expanded="true"] .core span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
.menu-badge:hover { border-color: rgba(255, 168, 104, 0.6); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Full-screen menu */
.menu {
  position: fixed; inset: 0; z-index: 15;
  background: rgba(11, 10, 16, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center;
  padding: 120px var(--gutter) 60px;
  opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s;
}
.menu.open { opacity: 1; visibility: visible; }
.menu ol { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.menu li { counter-increment: m; }
.menu a {
  display: inline-flex; align-items: baseline; gap: 18px;
  font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 5vw, 56px); line-height: 1.25;
  text-decoration: none; color: var(--ink);
}
.menu a::before { content: counter(m, decimal-leading-zero); font-family: var(--sans); font-size: 13px; color: var(--muted); letter-spacing: 0.1em; }
.menu a:hover em, .menu a:focus-visible em { color: var(--accent); }
.menu em { font-style: italic; }

/* ---------- Section dot navigator ---------- */
.dots {
  position: fixed; z-index: 10; right: calc(var(--gutter) * 0.5); top: 50%; transform: translateY(-50%);
  list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
}
.dots a { display: block; width: 24px; height: 24px; position: relative; }
.dots a::after {
  content: ""; position: absolute; left: 9px; top: 9px; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(239, 232, 221, 0.35); transition: transform .3s ease, background .3s ease;
}
.dots a[aria-current="true"]::after { background: var(--accent); transform: scale(1.6); }
.dots a span {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.dots a:hover span, .dots a:focus-visible span { opacity: 1; }

/* ---------- Panels: one idea per screen ---------- */
main { position: relative; z-index: 1; }
.panel {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px var(--gutter) 80px;
}
.panel .copy { max-width: min(560px, 46vw); }
.hero { justify-content: center; text-align: center; }
.hero .copy { max-width: 760px; }

.eyebrow {
  margin: 0 0 22px; font-size: 13px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.eyebrow b { color: var(--ink); font-weight: 600; }
h1, h2 {
  font-family: var(--serif); font-weight: 300; margin: 0 0 26px;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.015em; text-wrap: balance;
}
h1 { font-size: clamp(48px, 8.4vw, 124px); line-height: 0.98; }
h2 { font-size: clamp(36px, 5.2vw, 76px); line-height: 1.04; }
h1 em, h2 em { font-style: italic; color: var(--accent); font-weight: 300; }
.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 34em; margin: 0 0 34px; }
.hero .lead { margin-left: auto; margin-right: auto; max-width: 30em; }
.copy p { color: var(--muted); }
.copy p strong { color: var(--ink); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-decoration: none;
  transition: background .25s ease, transform .25s ease;
}
.btn:hover { background: var(--accent); }
.btn svg { width: 16px; height: 16px; }

.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 18px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 6px 14px; color: var(--muted); }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 20px; line-height: 1.4; }
.steps strong { color: var(--ink); font-weight: 600; }


footer {
  position: relative; z-index: 1; border-top: 1px solid var(--line);
  padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted); background: var(--bg);
}

/* Static illustration: only shown when motion is reduced (or canvas unavailable). */
.static-art { display: none; width: min(420px, 80vw); height: auto; margin: 0 auto 32px; }
.no-canvas .static-art { display: block; }

@media (prefers-reduced-motion: reduce) {
  #field { display: none; }
  .static-art { display: block; }
  .menu-badge svg.ring { animation: none; }
  .menu, .btn, .dots a::after { transition: none; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding: 14px 16px; }
  .brand { font-size: 18px; }
  .menu-badge { width: 66px; height: 66px; }
  .menu-badge text { font-size: 10px; }
  .dots { right: 6px; gap: 10px; }
  .dots a { width: 14px; height: 14px; }
  .dots a::after { left: 4px; top: 4px; width: 5px; height: 5px; }
  /* Shapes live in the top part of the screen on phones; copy sits below them. */
  .panel { align-items: flex-end; padding: 52vh 28px 56px 20px; padding: 50svh 28px 56px 20px; }
  .panel .copy { max-width: 100%; }
  .hero { align-items: flex-end; text-align: left; padding-top: 46svh; }
  .hero .lead { margin-left: 0; }
  h2 { font-size: clamp(32px, 9vw, 44px); margin-bottom: 18px; }
  h1 { font-size: clamp(46px, 14vw, 64px); }
  .eyebrow { margin-bottom: 14px; }
  .static-art { margin: 0 0 24px; width: 70vw; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .panel { padding-top: 120px; align-items: center; }
}

/* Soft fade behind the fixed header so scrolling copy never collides with it. */
.top::before {
  content: ""; position: absolute; inset: 0 0 -30px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(11, 10, 16, 0.92) 0%, rgba(11, 10, 16, 0.75) 55%, rgba(11, 10, 16, 0) 100%);
}

/* ---------- Footer links ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(239, 232, 221, 0.35); }
.footer-links a:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- Contact form ---------- */
.contact-form { display: grid; gap: 18px; margin: 30px 0 0; max-width: 520px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--ink); background: rgba(19, 17, 26, 0.88);
  border: 1px solid rgba(239, 232, 221, 0.42); border-radius: 10px;
  padding: 12px 14px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.contact-form .btn { justify-self: start; border: 0; cursor: pointer; font-family: inherit; min-height: 48px; }
.contact-form .btn[disabled] { opacity: 0.7; cursor: progress; }
.form-fine { margin: 0; font-size: 14px; }
.copy .form-fine a, .copy .form-alt a, .form-result a { color: var(--ink); text-underline-offset: 3px; }
.form-alt { margin-top: 22px; font-size: 15px; }
.form-status { margin: 0; min-height: 1.6em; font-weight: 600; }
.form-status.ok, .copy .form-result.ok { color: #9be2b0; }
.form-status.err, .copy .form-result.err { color: #ffb0a0; }
.form-result { scroll-margin-top: 130px; display: none; margin: 24px 0 0; padding: 14px 16px; border-radius: 10px; border: 1px solid currentColor; background: rgba(11, 10, 16, 0.85); font-weight: 600; }
.form-result:target, .form-result.show { display: block; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Legal pages ---------- */
.doc { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 140px var(--gutter) 80px; }
.doc h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.04; margin-bottom: 18px; }
.doc h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; margin: 44px 0 12px; }
.doc p, .doc li { color: #cfc8bc; }
.doc a { color: var(--ink); text-underline-offset: 3px; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.doc dt { color: var(--muted); }
.doc dd { margin: 0; }
.doc .updated { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .doc dl { grid-template-columns: 1fr; gap: 2px; } .doc dd { margin-bottom: 12px; } }

/* ---------- Touch and phone ---------- */
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 4px; }
.top-right { gap: 10px; }
@media (max-width: 760px) {
  /* The section dots are too small to tap reliably on a phone; the Menu badge does the same job. */
  .dots { display: none; }
  .panel { padding-right: 20px; }
  .brand-mark { width: 26px; height: 22.9px; }
  .doc { padding-top: 120px; }
  .contact-form .btn { justify-self: stretch; justify-content: center; }
}
@media (min-width: 761px) {
  /* Name and email side by side to keep the contact panel close to one screen. */
  .contact-form { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .contact-form > * { grid-column: 1 / -1; }
  .contact-form > .field:nth-of-type(-n+2) { grid-column: auto; }
  .field textarea { min-height: 120px; }
}

/* Header mark follows the particle field: head = human (warm), brackets = machine (cool). */
.brand-mark .mark-head { fill: var(--warm); }
.brand-mark .mark-brackets { fill: var(--cool); }
