/* MatGen shared shell for matgen.ai and the product sub-sites.
   Source: design/proposal/assets/site.css.
   Builds on matgen-tokens.css (--mg-*, --lamp-*, --spark-*).
   Light "bone" theme (matgen.ai). */

:root {
  --bg:        #f7f5f0;
  --bg-raised: #ffffff;
  --bg-sunk:   var(--mg-paper-1);
  --ink:       var(--mg-ink-0);
  --ink-2:     #4e4a5a;
  --ink-3:     #5a5666;
  --ink-4:     #8c8898;
  --line:      var(--mg-paper-3);
  --line-2:    var(--mg-paper-2);
  --accent:    var(--mg-ink-0);
  --accent-fg: #f7f5f0;
  --shadow:    0 18px 48px -24px rgba(13, 12, 16, 0.28);
  --maxw:      1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--mg-font-sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 48px; position: relative; }

/* ── Type ─────────────────────────────────────────────── */
.h1 {
  font-family: var(--mg-font-mono); font-weight: 500; margin: 0;
  font-size: clamp(44px, 6.4vw, 96px); line-height: 0.98; letter-spacing: -0.045em;
  text-wrap: balance;
}
.h2 {
  font-family: var(--mg-font-mono); font-weight: 500; margin: 0;
  font-size: clamp(30px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -0.035em;
  text-wrap: balance;
}
.h3 {
  font-family: var(--mg-font-mono); font-weight: 500; margin: 0;
  font-size: 20px; line-height: 1.25; letter-spacing: -0.02em;
}
.lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 60ch; margin: 24px 0 0; }
.amber  { color: var(--lamp-amber); }
.indigo { color: var(--spark-indigo); }

/* Values the owner still has to supply (legal entity, address, ...). */
.fill {
  background: rgba(200, 148, 62, 0.16); color: inherit;
  border-bottom: 1px dashed var(--lamp-amber);
  padding: 0 3px; border-radius: 2px; font-style: normal;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--mg-font-mono); font-size: 14px; font-weight: 500;
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); cursor: pointer;
  transition: transform .2s var(--mg-ease), background .2s var(--mg-ease), border-color .2s var(--mg-ease), color .2s var(--mg-ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost  { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--amber  { background: var(--lamp-amber); border-color: var(--lamp-amber); color: #17140f; }
.btn--amber:hover { background: var(--lamp-amber-2); border-color: var(--lamp-amber-2); }
.btn--indigo { background: var(--spark-indigo); border-color: var(--spark-indigo); color: #fff; }
.btn--indigo:hover { background: var(--spark-indigo-2); border-color: var(--spark-indigo-2); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--lg { padding: 16px 26px; font-size: 15px; }
.link-arrow {
  font-family: var(--mg-font-mono); font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: border-color .2s var(--mg-ease);
}
.link-arrow:hover { border-color: currentColor; }

/* Skip link: the first stop for the keyboard, shown only on focus.
   Its target is each page's <main id="main">. */
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-family: var(--mg-font-mono); font-size: 13px;
}
.skip:focus { top: 12px; }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  max-width: var(--maxw); margin: 0 auto; padding: 0 48px; height: 68px;
  display: flex; align-items: center; gap: 36px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand__name { font-family: var(--mg-font-mono); font-size: 16px; font-weight: 500; letter-spacing: -0.5px; }
.brand__dot  { color: var(--spark-indigo); }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer;
  font-family: var(--mg-font-sans); font-size: 14px; color: var(--ink-2);
  transition: color .15s var(--mg-ease), background .15s var(--mg-ease);
}
.nav__link:hover, .nav__item:hover > .nav__link, .nav__link[aria-expanded='true'] { color: var(--ink); background: var(--line-2); }
.nav__link[aria-current='page'] { color: var(--ink); }
.nav__caret { width: 9px; height: 9px; opacity: .6; transition: transform .2s var(--mg-ease); }
.nav__item:hover .nav__caret, .nav__link[aria-expanded='true'] .nav__caret { transform: rotate(180deg); }

.menu {
  position: absolute; top: calc(100% + 10px); left: -12px; z-index: 60;
  min-width: 320px; padding: 10px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s var(--mg-ease), transform .18s var(--mg-ease), visibility .18s;
}
.menu::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav__item:hover > .menu, .nav__link[aria-expanded='true'] + .menu, .menu:focus-within { opacity: 1; visibility: visible; transform: none; }
.menu--wide { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 4px 10px; min-width: 620px; }
.menu__item {
  display: block;
  padding: 10px 12px; border-radius: 10px; transition: background .15s var(--mg-ease);
}
.menu__item:hover { background: var(--line-2); }
.menu__title { font-size: 14px; font-weight: 500; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.menu__sub   { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; margin-top: 3px; }
.menu__foot {
  grid-column: 1 / -1; margin-top: 6px; padding: 12px 12px 6px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; font-family: var(--mg-font-mono); font-size: 12px; color: var(--ink-3);
}

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* Under 860px the nav is hidden and this <details> menu takes its place.
   It opens without script; the panel hangs under the sticky header. */
.site-header .nav-mobile { display: none; }
.site-header .nav-mobile > summary {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  list-style: none; cursor: pointer;
  font-family: var(--mg-font-mono); font-size: 13px; color: var(--ink);
}
.site-header .nav-mobile > summary::-webkit-details-marker { display: none; }
.site-header .nav-mobile[open] > summary { background: var(--line-2); }
.site-header .nav-mobile__panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
  padding: 8px 22px 16px;
  background: var(--bg-raised); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.site-header .nav-mobile__panel ul { list-style: none; margin: 0; padding: 0; }
.site-header .nav-mobile__panel a {
  display: block; padding: 12px 0; font-size: 16px; color: var(--ink);
  border-bottom: 1px solid var(--line-2);
}
.site-header .nav-mobile__panel li:last-child a { border-bottom: 0; }

/* ── Status pill / badges ─────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-family: var(--mg-font-mono); font-size: 11.5px; letter-spacing: 0;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3);
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: #2f9866; box-shadow: 0 0 0 3px rgba(47,152,102,.18); }
.pill--soon .pill__dot { background: var(--lamp-amber); box-shadow: 0 0 0 3px rgba(200,148,62,.2); }
.pill--dev  .pill__dot { background: var(--spark-indigo); box-shadow: 0 0 0 3px rgba(91,91,214,.2); }

/* ── Sections ─────────────────────────────────────────── */
.section { padding: 96px 0; border-top: 1px solid var(--line); position: relative; }
.section--flush { border-top: 0; }
.section--sunk  { background: var(--bg-sunk); }
.section__head  { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 48px; }
.section__head .lede { margin-top: 16px; }

.grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(13,12,16,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,12,16,0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 25%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 30%, black 25%, transparent 75%);
}

.card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 28px;
  transition: border-color .2s var(--mg-ease), transform .2s var(--mg-ease), box-shadow .2s var(--mg-ease);
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.check-list li::before { content: '›'; font-family: var(--mg-font-mono); color: var(--lamp-amber); font-weight: 500; }

/* CTA band */
.cta-band {
  display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center;
  padding: 56px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-raised);
  position: relative; overflow: hidden;
}
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 72px 0 32px; background: var(--bg); position: relative; }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
.site-footer__about p { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; max-width: 32ch; margin: 16px 0 20px; }
.site-footer h4 {
  margin: 0 0 16px; font-family: var(--mg-font-mono); font-size: 12.5px; font-weight: 500;
  color: var(--ink);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-footer li a, .site-footer li button {
  display: inline-block; padding: 4px 0;
  font-size: 14px; color: var(--ink-2); background: none; border: 0; cursor: pointer;
  transition: color .15s var(--mg-ease); text-align: left;
}
.site-footer li a:hover, .site-footer li button:hover { color: var(--ink); }
.site-footer__bottom {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-family: var(--mg-font-mono); font-size: 12.5px; color: var(--ink-3); letter-spacing: .2px;
}

/* ── Cookie notice + settings ─────────────────────────── */
.consent {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: calc(100vw - 40px);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 48px -18px rgba(13,12,16,.35); padding: 8px 8px 8px 14px;
  transform: translateY(8px); opacity: 0; transition: opacity .25s var(--mg-ease), transform .25s var(--mg-ease);
}
.consent[data-open='true'] { transform: none; opacity: 1; }
.consent[hidden] { display: none; }
.consent__icon { color: var(--lamp-amber); flex: none; }
.consent__text { margin: 0 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); white-space: nowrap; }
.consent__text a { text-decoration: underline; text-underline-offset: 2px; }
.consent .btn--sm { padding: 6px 12px; font-size: 12.5px; }
/* While the notice shows, the footer ends above it, so the notice
   covers no footer link. */
body:has(.consent[data-open='true']) .site-footer { padding-bottom: 96px; }
@media (max-width: 560px) {
  .consent { left: 12px; right: 12px; bottom: 12px; }
  .consent__text { white-space: normal; flex: 1; }
  body:has(.consent[data-open='true']) .site-footer { padding-bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { transition: none; }
}

/* ── About page ─────────────────────────────────────── */
/* The page body of /about/, kept from its earlier layout
   inside the shared header and footer. */
.sub-page { position: relative; }

.sub-hero { padding: 80px 0 48px; max-width: 920px; }
.sub-hero__eyebrow {
  font-family: var(--mg-font-mono); font-size: 12px;
  color: var(--mg-text-dim); margin-bottom: 36px; letter-spacing: 1.5px; text-transform: uppercase;
}
.sub-hero__title {
  font-family: var(--mg-font-mono); font-size: clamp(44px, 6vw, 88px); line-height: 0.98;
  letter-spacing: -3px; font-weight: 500; margin: 0; color: var(--mg-ink-0); text-wrap: balance;
}
.sub-hero__sub { font-size: 17px; line-height: 1.55; color: #4e4a5a; max-width: 620px; margin-top: 28px; }

/* Contact band */
.sub-cta { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; padding: 80px 0; }
.sub-cta__lbl { font-family: var(--mg-font-mono); font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--mg-text-dim); margin-bottom: 18px; }
.sub-cta__h   { font-family: var(--mg-font-mono); font-size: clamp(28px, 3.5vw, 48px); letter-spacing: -1.5px; font-weight: 500; margin: 0 0 16px; line-height: 1.1; color: var(--mg-ink-0); max-width: 16ch; }
.sub-cta p    { color: #5a5666; font-size: 15px; line-height: 1.5; max-width: 50ch; margin: 0; }
.sub-cta__btn {
  font-family: var(--mg-font-mono); font-size: 15px; padding: 18px 28px;
  border: 1px solid var(--mg-ink-0); border-radius: 999px; color: var(--mg-ink-0);
  transition: all .3s var(--mg-ease); white-space: nowrap;
}
.sub-cta__btn:hover { background: var(--mg-ink-0); color: #f7f5f0; }

/* Not-found page (templates/404.html) */
.not-found__actions { margin-top: 32px; }

@media (max-width: 800px) {
  .sub-cta { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1080px) {
  .site-footer__grid { grid-template-columns: repeat(3, 1fr); }
  .site-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .wrap, .site-header__row { padding: 0 22px; }
  .nav, .header-actions .hide-sm { display: none; }
  .site-header .nav-mobile { display: block; }
  .site-header__row { justify-content: space-between; }
  .section { padding: 64px 0; }
  .section__head { flex-direction: column; align-items: flex-start; }
  .cta-band { grid-template-columns: 1fr; padding: 32px; }
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}
