/* ==========================================================================
   ErgonCraft homepage — components & layout
   Uses only the semantic tokens from tokens.css.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Base --------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: var(--space-4); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Brand -------------------------------------------------------------- */

.mark { width: 2.25rem; height: auto; aspect-ratio: 38536 / 46135; flex: none; }

.wordmark {
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark b { font-weight: 900; }
.wordmark span { font-weight: 400; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 4.25rem;
}

.nav { display: flex; align-items: center; gap: var(--space-5); }

.nav-links { display: flex; gap: var(--space-5); }
.nav-links a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .2s;
}
.nav-links a:hover { color: var(--ink); }

/* Segmented switches: colour palette, language */
.switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.switch button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.switch .swatch {
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-dark) 50%, var(--sw-accent) 50%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25);
}
.switch-text button {
  padding: 0.3rem 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.switch + .switch { margin-left: calc(-1 * var(--space-3)); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .switch .label { display: none; }
  .switch button { padding: 0.3rem; }
  .switch-text button { padding: 0.3rem 0.5rem; }
}

/* Small phones: logo + both switches must fit in 320–390px */
@media (max-width: 480px) {
  .site-header .container { gap: var(--space-3); }
  .brand { gap: var(--space-2); }
  .site-header .mark { width: 1.9rem; }
  .site-header .wordmark { font-size: 1.05rem; }
  .nav { gap: var(--space-2); }
  .switch + .switch { margin-left: 0; }
}
@media (max-width: 350px) {
  .site-header .wordmark { font-size: 0.92rem; }
  .switch-text button { padding: 0.3rem 0.4rem; }
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 1rem; height: 1rem; }

.btn-primary { background: var(--accent); color: var(--c-dark-1); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, #fff); }

.btn-ghost {
  color: var(--dark-ink);
  border: 1px solid var(--dark-line);
}
.btn-ghost:hover { border-color: var(--dark-muted); }

/* --- Section scaffolding ------------------------------------------------ */

.section { padding-block: var(--space-9); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before {
  content: "";
  width: 1.5rem; height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section-head { max-width: 46rem; margin-bottom: var(--space-7); }
.section-head h2 { font-size: var(--fs-2xl); font-weight: 800; margin-top: var(--space-4); }
.section-head p { margin-top: var(--space-4); font-size: var(--fs-lg); color: var(--ink-muted); }

/* Dark sections re-map the light tokens */
.is-dark {
  --ink: var(--dark-ink);
  --ink-muted: var(--dark-muted);
  --line: var(--dark-line);
  --accent-ink: var(--accent);
  background: var(--dark-bg);
  color: var(--ink);
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 2rem + 8vw, 8rem);
}
.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: var(--space-8);
}

.hero h1 {
  margin-top: var(--space-5);
  font-size: var(--fs-3xl);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero h1 em { font-style: normal; color: var(--accent); }

.hero .lead {
  margin-top: var(--space-5);
  max-width: 34rem;
  font-size: var(--fs-lg);
  color: var(--ink-muted);
}
.hero .lead strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

.hero-mark {
  justify-self: center;
  width: min(100%, 340px);
  height: auto;
  aspect-ratio: 2281 / 2722;
  filter: drop-shadow(0 30px 60px rgb(0 0 0 / .35));
  animation: rise 1.1s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; gap: var(--space-7); }
  .hero-mark { order: -1; width: 180px; justify-self: start; }
}

/* --- Manifesto ---------------------------------------------------------- */

.belief {
  max-width: 50rem;
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.belief strong { font-weight: 800; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.principle {
  position: relative;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.principle:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px color-mix(in oklab, var(--c-dark-1) 45%, transparent);
}
.principle .icon {
  width: 2.75rem; height: 2.75rem;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-ink);
}
.principle .icon svg { width: 1.4rem; height: 1.4rem; }
.principle h3 { font-size: var(--fs-lg); font-weight: 700; }
.principle p { margin-top: var(--space-3); color: var(--ink-muted); }

@media (max-width: 860px) {
  .principles { grid-template-columns: 1fr; }
}

/* Statement band */
.statement {
  margin-top: var(--space-8);
  padding: clamp(2rem, 1rem + 4vw, 4rem);
  border-radius: var(--radius-lg);
  text-align: center;
}
.statement p:first-child {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 40rem;
  margin-inline: auto;
}
.statement p:first-child span { color: var(--accent); }
.statement .tagline { margin-top: var(--space-5); color: var(--ink-muted); }
.statement .tagline b { font-weight: 900; color: var(--ink); }

/* The name */
.name-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  align-items: start;
  margin-top: var(--space-7);
  padding-top: var(--space-7);
  border-top: 1px solid var(--line);
}
.name-note .greek {
  font-size: clamp(3rem, 2rem + 4vw, 5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
}
.name-note h3 { font-size: var(--fs-base); font-weight: 700; }
.name-note p { margin-top: var(--space-2); max-width: 44rem; color: var(--ink-muted); }
.name-note em { color: var(--ink); }

@media (max-width: 640px) {
  .name-note { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* --- Products ----------------------------------------------------------- */

.products { background: var(--surface-sunk); }

/* Pull quote (Thrice) */
.quote {
  margin: 0 0 var(--space-7);
  padding-left: clamp(1rem, 0.5rem + 2vw, 2rem);
  border-left: 3px solid var(--accent);
  max-width: 46rem;
}
.quote blockquote { margin: 0; }
.quote blockquote p {
  font-size: var(--fs-xl);
  font-weight: 300;
  font-style: italic;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.quote blockquote p::before { content: "\201C"; }
.quote blockquote p::after  { content: "\201D"; }
.quote figcaption { margin-top: var(--space-2); }
.quote cite { font-size: var(--fs-sm); font-style: normal; color: var(--ink-muted); }
.quote cite::before { content: "— "; }
.quote-remark {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.product {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-7);
  align-items: center;
  padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.product-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--accent-wash);
  color: var(--accent-ink);
}
.tag.outline { background: transparent; border: 1px solid var(--line); color: var(--ink-muted); }

.product h3 {
  margin-top: var(--space-4);
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.product .pitch { margin-top: var(--space-3); font-size: var(--fs-lg); color: var(--ink-muted); }

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5) var(--space-6);
  margin-top: var(--space-6);
}
.features li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); }
.features svg { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; color: var(--accent-ink); }
.features h4 { font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.005em; }
.features p { margin-top: 0.15rem; font-size: var(--fs-sm); color: var(--ink-muted); line-height: 1.5; }

@media (max-width: 960px) {
  .product { grid-template-columns: 1fr; }
  .product .phone { order: -1; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
}

/* Phone illustration of the radial menu */
.phone {
  justify-self: center;
  width: min(100%, 300px);
  filter: drop-shadow(0 28px 50px color-mix(in oklab, var(--c-dark-1) 35%, transparent));
}
.phone .rm-pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 7s var(--ease) infinite both;
}
.phone .rm-trail {
  stroke-dasharray: 260;
  animation: trail 7s var(--ease) infinite both;
}
.phone .rm-pop.late { animation-name: pop-late; }

@keyframes pop {
  0%, 6%    { opacity: 0; transform: scale(.4); }
  14%, 86%  { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: scale(.4); }
}
@keyframes pop-late {
  0%, 30%   { opacity: 0; transform: scale(.4); }
  40%, 86%  { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: scale(.4); }
}

.ph-body      { fill: var(--c-dark-2); }
.ph-screen    { fill: var(--c-dark-1); }
.ph-dim       { fill: var(--c-dark-2); }
.ph-ui        { fill: none; stroke: var(--c-mid); stroke-width: 1.5; }
.ph-small     { fill: var(--dark-muted); font: 500 11px var(--font); }
.ph-title     { fill: var(--c-light); font: 700 15px var(--font); letter-spacing: -0.01em; }
.ph-cat       { fill: var(--c-dark-2); stroke: var(--c-accent); stroke-width: 2; }
.ph-cat-on    { fill: var(--c-accent); }
.ph-glyph     { fill: none; stroke: var(--c-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-glyph-on  { fill: none; stroke: var(--c-dark-1); stroke-width: 2.2; }
.ph-app       { fill: var(--c-dark-2); stroke: var(--c-mid); stroke-width: 1.5; }
.ph-app-on    { fill: var(--c-accent); }
.ph-halo      { fill: none; stroke: var(--c-accent); stroke-width: 1.5; opacity: .45; }
.ph-trail     { fill: none; stroke: var(--c-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.ph-start     { fill: var(--c-dark-2); stroke: var(--c-accent); stroke-width: 3; }
.ph-start-halo { fill: color-mix(in oklab, var(--c-accent) 14%, transparent); }
@keyframes trail {
  0%, 30%   { stroke-dashoffset: 260; opacity: 0; }
  32%       { opacity: 1; }
  52%, 86%  { stroke-dashoffset: 0; opacity: 1; }
  94%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

.more {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding: var(--space-5) var(--space-6);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
}
.more .mark { width: 1.6rem; opacity: .55; }

/* --- Impressum ---------------------------------------------------------- */

.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}
.legal-grid h3 {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
}
.legal-grid p, .legal-grid address { font-style: normal; font-size: var(--fs-sm); }
.legal-grid a, .legal-text a { color: var(--accent-ink); text-underline-offset: 3px; }

.legal-text {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--space-5);
  max-width: 52rem;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.legal-text h3 { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); margin-bottom: var(--space-1); }

/* Placeholders that still need real data */
.todo {
  background: color-mix(in oklab, var(--accent) 30%, transparent);
  padding: 0 .25em;
  border-radius: 4px;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer { padding-block: var(--space-7); }
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.site-footer .brand .wordmark { color: var(--ink); }
.site-footer small { font-size: var(--fs-xs); color: var(--ink-muted); }
.footer-links { display: flex; gap: var(--space-5); font-size: var(--fs-sm); }
.footer-links a { color: var(--ink-muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* --- Motion preferences ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
