/* ==========================================================================
   Aych Labs — neutral light shell
   The shell stays neutral; each app's identity shows only through --accent,
   which policy pages and app cards set inline. Accent is used for bars, dots
   and rules, never for body text, so any app color stays readable.
   ========================================================================== */

:root {
  --paper:   #F7F7F5;
  --surface: #FFFFFF;
  --ink:     #14171C;
  --ink-2:   #3A4049;
  --muted:   #6A717C;
  --rule:    #E3E4E1;
  --rule-2:  #CFD1CC;
  --accent:  #14171C;

  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-mark: "Orbitron", "IBM Plex Sans", sans-serif;

  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27.713' height='48' viewBox='0 0 27.713 48'%3E%3Cpath d='M13.856 0L27.713 8V24L13.856 32L0 24V8Z M13.856 32V48' fill='none' stroke='%2314171C' stroke-opacity='.09' stroke-width='1'/%3E%3C/svg%3E");

  --wrap: 1120px;
  --measure: 68ch;
  --radius: 4px;
}

:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.7 var(--font-body);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.label {
  font: 500 0.72rem/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---- Brand ---- */
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.logomark { width: 28px; height: 28px; flex: none; }
.brand__word { font: 700 .95rem/1 var(--font-mark); letter-spacing: .14em; }
.brand--small .logomark { width: 22px; height: 22px; }
.brand--small .brand__word { font-size: .8rem; }

/* ---- Nav ---- */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247,247,245,.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { font-size: .92rem; font-weight: 500; text-decoration: none; color: var(--ink-2); }
.site-nav ul a:hover { color: var(--ink); }

/* ---- Buttons ---- */
.button {
  display: inline-block;
  padding: .75rem 1.25rem;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink); border-radius: var(--radius);
  font-weight: 500; text-decoration: none;
}
.button:hover { background: #000; }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--surface); }

/* ---- Landing ---- */
.hero { position: relative; overflow: hidden; padding: clamp(4rem, 9vw, 7rem) 0 clamp(3.5rem, 7vw, 5.5rem); border-bottom: 1px solid var(--rule); }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--hex);
  -webkit-mask-image: radial-gradient(ellipse 60% 85% at 78% 45%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 60% 85% at 78% 45%, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 3rem; }
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  line-height: 1.06; letter-spacing: -0.025em; font-weight: 600;
  margin: 1rem 0 1.25rem; text-wrap: balance;
}
.hero__lede { max-width: 52ch; font-size: 1.15rem; color: var(--ink-2); margin: 0 0 2rem; }
.hero__tiles { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 1.25rem; }
.hero__tiles .app-icon:nth-child(even) { transform: translateY(1.5rem); }

/* App icon tile (placeholder until real icons exist) */
.app-icon {
  --size: 56px;
  width: var(--size); height: var(--size);
  border-radius: calc(var(--size) * .23);
  display: inline-grid; place-items: center; flex: none;
  background: var(--accent);
  color: var(--tile-ink, #fff);
  font: 600 calc(var(--size) * .34)/1 var(--font-body);
  letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 1px 2px rgba(20,23,28,.12);
  object-fit: cover;
}
.app-icon--xl {
  --size: 112px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 18px 40px -18px rgba(20,23,28,.45), 0 2px 6px rgba(20,23,28,.08);
}

.section-label { margin-bottom: .6rem; }
.section-title { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.015em; margin: 0 0 2rem; }
.apps { padding: 4.5rem 0 5rem; }
.app-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.app-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.app-card:hover { box-shadow: 0 14px 32px -20px rgba(20,23,28,.35); transform: translateY(-2px); }
.app-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.app-card h3 { font-size: 1.2rem; font-weight: 600; margin: 0; }
.app-card p { color: var(--ink-2); margin: .5rem 0 1.25rem; }
.app-card__links { list-style: none; margin: auto 0 0; padding: 1rem 0 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .9rem; }
.status { display: inline-flex; align-items: center; gap: .4rem; font: 500 .68rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding: .4rem .55rem; border: 1px solid var(--rule); border-radius: 999px; }
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-2); }
.status--testing .status__dot { background: #C99A2E; }
.status--live { color: var(--ink); }
.status--live .status__dot { background: #2E9E5B; }

.contact { padding: 4rem 0; border-top: 1px solid var(--rule); background: var(--surface); }
.contact__inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.contact .section-title { margin-bottom: .4rem; }
.contact p { margin: 0; color: var(--ink-2); }

/* ---- Policy pages ---- */
.policy__head {
  position: relative; overflow: hidden;
  background: var(--surface);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-bottom: 1px solid var(--rule); padding: 3.25rem 0 2.5rem;
}
.policy__head::after {
  content: ""; position: absolute; inset: 0; background: var(--hex); pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 55%);
          mask-image: linear-gradient(to left, #000 0%, transparent 55%);
}
.policy__head .wrap { position: relative; }
.policy__head::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.app-chip { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-weight: 600; font-size: .95rem; }
.app-chip__dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--accent); }
.policy__head h1 { font-size: clamp(2rem, 4.5vw, 2.85rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; margin: .6rem 0 1rem; }
.policy__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: 0; font-size: .9rem; color: var(--muted); }
.policy__meta a { color: var(--ink); font-weight: 500; }

.policy__grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; padding-top: 2.75rem; padding-bottom: 5rem; }
.toc { position: sticky; top: 5.5rem; align-self: start; font-size: .88rem; }
.toc summary { cursor: default; list-style: none; margin-bottom: .75rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 .9rem; border-left: 1px solid var(--rule-2); }
.toc li { margin: 0 0 .45rem; }
.toc a { color: var(--ink-2); text-decoration: none; line-height: 1.35; display: block; }
.toc a:hover { color: var(--ink); }

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose > p:first-child { font-size: 1.1rem; color: var(--ink-2); }
.prose h2 {
  font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3;
  margin: 3rem 0 1rem; padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  position: relative;
}
.prose h2::before { content: ""; position: absolute; top: -1px; left: 0; width: 2.5rem; height: 3px; background: var(--accent); }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin: 2rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 600; }
.prose blockquote {
  margin: 1.5rem 0; padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; width: 100%; margin: 1.5rem 0; font-size: .92rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .7rem .9rem; border-bottom: 1px solid var(--rule); }
.prose th { font: 500 .7rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prose tr:last-child td { border-bottom: 0; }
.prose code { font: .88em var(--font-mono); background: #EEEFEC; padding: .1em .35em; border-radius: 3px; }
.policy__contact { margin-top: 3rem !important; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .95rem; }

/* ---- Footer (ink) ---- */
.site-footer { background: var(--ink); color: #C9CDD3; font-size: .9rem; }
.site-footer .brand { color: #fff; }
.site-footer .label { color: #8A919B; }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2rem; padding-top: 3.5rem; padding-bottom: 2.75rem; }
.site-footer ul { list-style: none; margin: .75rem 0 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer ul a { color: #C9CDD3; text-decoration: none; }
.site-footer ul a:hover { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); }
.site-footer__note { color: #8A919B; margin: .75rem 0 0; }
.site-footer__base { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; padding-bottom: 1.5rem; color: #8A919B; font-size: .82rem; }
.site-footer :focus-visible { outline-color: #fff; }

/* ---- Small screens ---- */
@media (max-width: 860px) {
  .policy__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1.1rem; }
  .toc summary { cursor: pointer; margin-bottom: 0; }
  .toc details[open] summary { margin-bottom: .75rem; }
  .toc summary::after { content: " +"; }
  .toc details[open] summary::after { content: " –"; }
}
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__tiles { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-card { transition: none; }
  .app-card:hover { transform: none; }
}
@media (max-width: 560px) {
  .site-nav ul { gap: 1.1rem; }
  .brand__word { display: none; }
}
