/* Demetrix site — shared styles. Tokens match Brand/demetrix-design-system.md */
:root {
  --paper: #f4f2ec;
  --paper-2: #ebe8df;
  --ink: #17191a;
  --ink-2: #55585a;
  --line: #d9d5ca;
  --gold: #b8892b;
  --demetron: #1d6b66;
  --krasis: #2f6690;
  --rhiza: #9c5a2c;
  --accent: var(--demetron);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.6vw, 5.25rem);

  --gutter: 16px;
  --max: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121414; --paper-2: #1a1d1d; --ink: #f1efe8; --ink-2: #a5a7a2; --line: #2c3030;
    --gold: #d4a646; --demetron: #4fb3aa; --krasis: #6aa6d6; --rhiza: #d68b56;
  }
}
@media (min-width: 720px) { :root { --gutter: 40px; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { display: block; }
::selection { background: var(--accent); color: var(--paper); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.display { font-family: var(--serif); font-weight: 300; font-variation-settings: "opsz" 144; letter-spacing: -0.015em; line-height: 1.06; }
.display em { font-style: italic; color: var(--accent); letter-spacing: 0; }
h1.display { font-size: var(--step-4); }
h2.display { font-size: var(--step-3); }
h3 { font-family: var(--serif); font-weight: 400; font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.01em; }
.eyebrow { font-size: var(--step--1); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow b { color: var(--accent); font-weight: 500; }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--ink-2); max-width: 36em; font-weight: 300; }
.muted { color: var(--ink-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.wordmark { font-family: var(--sans); font-weight: 400; letter-spacing: 0.34em; font-size: 0.875rem; margin-right: -0.34em; }
.nav { display: flex; gap: 28px; align-items: center; font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; }
.nav .cta { color: var(--ink); border: 1px solid var(--ink); padding: 8px 16px; }
.nav .cta:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .nav a:not(.cta) { display: none; } }

/* Hero */
.hero { padding-top: clamp(64px, 10vw, 140px); padding-bottom: clamp(56px, 8vw, 112px); }
.hero .eyebrow { margin-bottom: 28px; }
.hero .lead { margin-top: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero-mark { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: end; }
.hero-mark svg.big { width: clamp(120px, 22vw, 260px); height: auto; color: var(--ink); }
@media (min-width: 900px) { .hero-mark { grid-template-columns: 1fr auto; } }
@media (max-width: 899px) { .hero-mark svg.big { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; font: 500 0.875rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--ink); transition: background .2s, color .2s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); }
.arrow::after { content: "→"; display: inline-block; margin-left: .6em; font-family: var(--sans); transition: transform .2s; }
a:hover .arrow::after, .arrow:hover::after { transform: translateX(4px); }

/* Sections */
section { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.section-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); }
@media (min-width: 900px) { .section-head { grid-template-columns: 1fr 1fr; align-items: end; } }

/* Line index (home) */
.line-index { list-style: none; border-bottom: 1px solid var(--line); }
.line-index a { display: grid; grid-template-columns: 48px 1fr; gap: 8px 16px; padding: 36px 0; border-top: 1px solid var(--line); text-decoration: none; }
.line-index .num { font-size: var(--step--1); letter-spacing: .14em; color: var(--ink-2); padding-top: 14px; }
.line-index .name { font-family: var(--serif); font-weight: 300; font-size: var(--step-3); line-height: 1; letter-spacing: -0.02em; }
.line-index .role { display: block; margin-top: 10px; color: var(--c); font-size: var(--step--1); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
.line-index .desc { color: var(--ink-2); max-width: 30em; grid-column: 2; }
.line-index .go { grid-column: 2; font-size: .875rem; letter-spacing: .12em; text-transform: uppercase; }
.line-index a:hover .name { color: var(--c); }
@media (min-width: 900px) {
  .line-index a { grid-template-columns: 64px 1.1fr 1fr auto; align-items: baseline; }
  .line-index .desc, .line-index .go { grid-column: auto; }
}

/* Grids and cards */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid > * { background: var(--paper); padding: 32px 28px; }
@media (min-width: 720px) { .grid.c2 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid.c5 { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 720px) and (max-width: 999px) { .grid.c5 { grid-template-columns: repeat(2, 1fr); } }
.card .k { display: block; font-size: var(--step--1); letter-spacing: .14em; color: var(--accent); margin-bottom: 20px; font-weight: 500; }
.card h3 { margin-bottom: 12px; }
.card p { color: var(--ink-2); font-size: 1rem; }
.card ul { list-style: none; margin-top: 16px; font-size: .9375rem; }
.card li { padding: 8px 0; border-top: 1px solid var(--line); }

/* Two column prose */
.split { display: grid; gap: 32px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.4fr; gap: 64px; } }
.prose p + p { margin-top: 1em; }
.prose p { max-width: 38em; }
.big-quote { font-family: var(--serif); font-weight: 300; font-size: var(--step-2); line-height: 1.35; max-width: 28em; }

/* Tables */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: var(--step--1); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
td:first-child { font-weight: 500; }

/* Element tiles (Rhiza) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { aspect-ratio: 1; background: var(--c); color: var(--on, #17191a); padding: 14px; display: grid; grid-template-rows: auto 1fr auto; }
.tile .z { font-size: .875rem; font-weight: 500; }
.tile .sym { font-family: var(--serif); font-weight: 400; font-size: 3.5rem; line-height: 1; align-self: center; }
.tile .m { font-size: .75rem; letter-spacing: .06em; }
.tile-label { margin-top: 10px; font-size: .9375rem; }
.tile-label span { display: block; color: var(--ink-2); font-size: .8125rem; }

/* Steps */
.steps { list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); font-size: var(--step--1); letter-spacing: .14em; color: var(--accent); padding-top: 6px; font-weight: 500; }
.steps h3 { font-size: var(--step-1); font-family: var(--sans); font-weight: 500; letter-spacing: 0; }
.steps p { color: var(--ink-2); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { border: 1px solid var(--line); padding: 6px 12px; font-size: .8125rem; letter-spacing: .08em; }

/* Contact band */
.band { background: var(--ink); color: var(--paper); border-top: 0; }
.band .eyebrow { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.band .lead { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.band .btn { border-color: var(--paper); }
.band .btn:hover { background: var(--paper); color: var(--ink); }
.band .display em { color: var(--gold); }
@media (prefers-color-scheme: dark) { .band .display em { color: #8a6516; } }
.greek { text-transform: none; letter-spacing: 0.04em; }

/* Footer */
.site-footer { padding: 56px 0 40px; font-size: .875rem; color: var(--ink-2); }
.site-footer .wrap { display: grid; gap: 32px; }
@media (min-width: 720px) { .site-footer .wrap { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer .brand { color: var(--ink); margin-bottom: 12px; }
.site-footer h4 { font-size: var(--step--1); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin-bottom: 12px; }
.site-footer ul { list-style: none; }
.site-footer li { padding: 3px 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.legal { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* Shop */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters button { font: 500 .8125rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); background: none; border: 1px solid var(--line); padding: 10px 14px; cursor: pointer; }
.filters button:hover { color: var(--ink); border-color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.product { display: grid; grid-template-rows: auto 1fr auto; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product[hidden] { display: none; }
.product .photo { background: #fff; aspect-ratio: 1; padding: 12px; border-bottom: 1px solid var(--line); }
.product .photo img { width: 100%; height: 100%; object-fit: contain; }
.product .info { padding: 20px 20px 0; }
.product .sku { font-size: .75rem; letter-spacing: .14em; color: var(--accent); font-weight: 500; }
.product h3 { font-size: 1.25rem; margin: 8px 0 6px; }
.product p { color: var(--ink-2); font-size: .9375rem; line-height: 1.5; }
.product .buy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px; }
.product .price { font-family: var(--serif); font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.product .buy a { font-size: .8125rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid currentColor; }
.product .buy a:hover { color: var(--accent); }

.ph { color: var(--ink-2); font-style: normal; border-bottom: 1px dashed var(--line); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Legal pages */
main .wrap > h2:not(.display) { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); margin: 2.2em 0 .5em; }
main .wrap > p:not(.eyebrow):not(.lead), main .wrap > ul { color: var(--ink-2); line-height: 1.65; margin-bottom: 1em; max-width: 40em; }
main .wrap > ul { padding-left: 1.2em; }
main .wrap > ul li { margin-bottom: .5em; }
main .wrap > h1 + .lead { margin-top: 1em; }
main .wrap > p a, main .wrap > ul a { text-decoration: underline; text-underline-offset: 3px; }
