/* ============================================================
   HelloWork 3.0 — shared design system
   "The Workshop": light editorial service register +
   dark product register. Monochrome with a disciplined
   pink→coral→orange accent used as hairline / glow only.
   ============================================================ */

/* ---------- Fonts ---------- */
/* Fonts are loaded via <link> tags in each page's <head>. */

/* ---------- Tokens ---------- */
:root {
  /* light / service register */
  --paper: #faf9f7;
  --paper-2: #f3f1ed;
  --ink: #0a0a0a;
  --ink-2: #1c1c1a;
  --muted: #6f6c66;
  --muted-2: #9a968e;
  --line: #e4e1db;
  --line-strong: #d4d0c8;

  /* dark / product register */
  --void: #0b0b0c;
  --void-2: #141417;
  --surface: #1a1a1e;
  --surface-2: #202026;
  --snow: #f5f4f2;
  --snow-muted: #9b9aa1;
  --snow-faint: #6c6b73;
  --dline: rgba(255, 255, 255, 0.09);
  --dline-2: rgba(255, 255, 255, 0.16);

  /* brand accent */
  --pink: #e91e8c;
  --coral: #f47b6c;
  --orange: #f7a668;
  --grad: linear-gradient(90deg, var(--pink), var(--coral) 55%, var(--orange));
  --grad-135: linear-gradient(135deg, var(--pink), var(--coral) 55%, var(--orange));

  /* accent intensity (tweakable): 0..1 scales how much color shows */
  --accent-strength: 1;

  /* type */
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  /* layout */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --motion: 1; /* tweakable 0/1 */
}

/* font-family tweak hook */
html[data-font='inter'] { --sans: 'Inter', system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01' 1, 'cv01' 1;
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------- Type scale ---------- */
.display {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-wrap: balance;
}
h1.display { font-size: clamp(2.6rem, 7vw, 5.4rem); }
h2.display { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow .tick {
  width: 7px; height: 7px;
  background: var(--ink);
  display: inline-block;
}
.eyebrow.grad .tick { background: var(--grad); }
.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 46ch;
  text-wrap: pretty;
}
.mono { font-family: var(--mono); }
.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* gradient ink */
.accent-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.underline-grad { position: relative; white-space: nowrap; }
.underline-grad::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -0.06em;
  height: 4px;
  background: var(--grad);
  opacity: var(--accent-strength);
  transform: scaleX(var(--accent-strength));
  transform-origin: left;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 152px); }
.section-sm { padding-block: clamp(48px, 7vw, 96px); }
.divider { height: 1px; background: var(--line); border: 0; }
.cols { display: grid; gap: clamp(28px, 4vw, 64px); }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--mono);
  font-size: 0.8rem; letter-spacing: 0.04em;
  padding: 0.92em 1.4em;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--bg);
  cursor: pointer;
  transition: gap .25s ease, background .2s ease, color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.btn:hover { gap: 0.72em; }
.btn .arr { transition: transform .25s ease; }
.btn:hover .arr { transform: translateX(2px); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--lg { padding: 1.05em 1.7em; font-size: 0.84rem; }
.on-dark .btn, .dark .btn { --bg: var(--snow); --fg: var(--void); }
.on-dark .btn--ghost { --bg: transparent; --fg: var(--snow); border-color: var(--dline-2); }
.on-dark .btn--ghost:hover { border-color: var(--snow); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand .brand-logo { height: 26px; width: auto; display: block; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.brand .word { height: 17px; width: auto; color: var(--ink); }
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav a {
  font-family: var(--mono);
  font-size: 0.74rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); position: relative; padding: 4px 0; white-space: nowrap;
  transition: color .2s ease;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink); }
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--coral); transition: width .25s ease;
}
.nav a:hover::after, .nav a[aria-current='page']::after { width: 100%; }
.header-cta { display: flex; align-items: center; gap: 14px; }
.menu-btn { display: none; }
.mobile-nav { display: none; }

@media (max-width: 880px) {
  .nav, .header-cta .btn { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line-strong); background: transparent;
    cursor: pointer;
  }
  .mobile-nav {
    display: none; flex-direction: column; gap: 2px;
    padding: 8px var(--gutter) 20px; border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    font-family: var(--mono); font-size: 0.84rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--muted); padding: 12px 0; border-bottom: 1px solid var(--line);
  }
  .mobile-nav a:last-child { border-bottom: 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--void); color: var(--snow);
  padding-block: clamp(56px, 8vw, 96px);
}
.site-footer .grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 56px; border-bottom: 1px solid var(--dline);
}
.site-footer h4 {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--snow-faint); margin: 0 0 18px; font-weight: 500;
}
.site-footer nav { display: flex; flex-direction: column; gap: 12px; }
.site-footer nav a, .site-footer .loc span {
  color: var(--snow-muted); font-size: 0.92rem; transition: color .2s ease;
}
.site-footer nav a:hover { color: var(--coral); }
.site-footer .loc { display: flex; flex-direction: column; gap: 12px; }
.foot-word { height: 18px; width: auto; color: var(--snow); margin-bottom: 16px; opacity: .85; }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 28px; font-family: var(--mono); font-size: 0.76rem; color: var(--snow-faint);
  flex-wrap: wrap;
}
.foot-bottom a:hover { color: var(--coral); }
@media (max-width: 760px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ---------- Reveal animation (capture-safe: opacity flips instantly, transform eases) ---------- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: transform .75s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  * { scroll-behavior: auto !important; }
}
html[data-motion='0'] .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
html[data-motion='0'] .anim-pulse, html[data-motion='0'] .spin { animation: none !important; }

/* ---------- Dark section wrapper ---------- */
.dark {
  background: var(--void); color: var(--snow);
}
.dark .eyebrow { color: var(--snow-faint); }
.dark .eyebrow .tick { background: var(--snow); }
.dark .lead { color: var(--snow-muted); }
.dark .divider { background: var(--dline); }
.dark .kicker { color: var(--snow-faint); }
.dark ::selection { background: var(--snow); color: var(--void); }

/* ---------- Generic product card (dark UI) ---------- */
.pcard {
  background: var(--void-2);
  border: 1px solid var(--dline);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 60px -30px rgba(0,0,0,.7);
}
.pcard__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--dline);
}
.pcard__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); }
.pcard__title {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em;
  color: var(--snow-muted); margin-left: 4px;
}
.tag {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 7px; border: 1px solid var(--dline-2);
  color: var(--snow-muted); border-radius: 4px;
}
.tag--ev { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 45%, transparent); }
.tag--inf { color: var(--snow-muted); }

/* gradient hairline */
.grad-rule { height: 2px; background: var(--grad); opacity: var(--accent-strength); border: 0; }
.grad-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--coral) 22%, transparent), transparent 70%);
  opacity: calc(var(--accent-strength) * 0.55);
}

/* ---------- Header scrolled ---------- */
.site-header.scrolled { box-shadow: 0 1px 0 var(--line), 0 10px 30px -24px rgba(0,0,0,.25); }

/* ---------- Header: dark variant ---------- */
.site-header.is-dark {
  background: color-mix(in srgb, var(--void) 80%, transparent);
  border-bottom: 1px solid var(--dline);
}
.site-header.is-dark .brand { color: var(--snow); }
.site-header.is-dark .brand .word { color: var(--snow); }
.site-header.is-dark .brand-logo { filter: invert(1); }
.site-header.is-dark .nav a { color: var(--snow-muted); }
.site-header.is-dark .nav a:hover, .site-header.is-dark .nav a[aria-current='page'] { color: var(--snow); }
.site-header.is-dark .btn { --bg: var(--snow); --fg: var(--void); }
.site-header.is-dark.scrolled { box-shadow: 0 1px 0 var(--dline), 0 12px 30px -22px rgba(0,0,0,.6); }
.site-header.is-dark .menu-btn { border-color: var(--dline-2); color: var(--snow); }
.site-header.is-dark .mobile-nav { background: var(--void); border-color: var(--dline); }
.site-header.is-dark .mobile-nav a { color: var(--snow-muted); border-color: var(--dline); }

/* ---------- Tweaks panel ---------- */
.hw-tweaks { position: fixed; right: 18px; bottom: 18px; z-index: 200; font-family: var(--sans); }
.hw-tweaks__fab {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--paper); cursor: pointer; display: grid; place-content: center; gap: 3px;
  box-shadow: 0 10px 26px -12px rgba(0,0,0,.4); transition: transform .2s ease;
}
.hw-tweaks__fab:hover { transform: translateY(-2px); }
.hw-tweaks__fab span { display: block; width: 16px; height: 2px; background: var(--ink); }
.hw-tweaks__fab span:nth-child(2) { width: 11px; background: var(--coral); }
.hw-tweaks__panel {
  position: absolute; right: 0; bottom: 58px; width: 248px;
  background: var(--paper); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.4); padding: 16px;
}
.hw-tweaks__head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.hw-tweaks__x { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); line-height: 1; }
.hw-tweaks__row { margin-bottom: 13px; }
.hw-tweaks__row label {
  display: block; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px;
}
.hw-seg { display: flex; border: 1px solid var(--line-strong); }
.hw-seg button {
  flex: 1; padding: 7px 4px; border: 0; border-right: 1px solid var(--line);
  background: var(--paper); cursor: pointer; font-family: var(--mono);
  font-size: 0.68rem; color: var(--muted); transition: background .15s ease, color .15s ease;
}
.hw-seg button:last-child { border-right: 0; }
.hw-seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.hw-tweaks__note { font-size: 0.66rem; color: var(--muted-2); margin: 6px 0 0; line-height: 1.4; }

/* ---------- Context engine visual ---------- */
.hw-engine { width: 100%; }
.hw-engine__svg { width: 100%; height: auto; display: block; overflow: visible; }
.eng-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em;
  fill: rgba(255,255,255,0.78); text-transform: uppercase;
}
.eng-sub { font-family: var(--mono); font-size: 6.6px; fill: rgba(255,255,255,0.38); }
.eng-clabel {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  fill: rgba(255,255,255,0.9); font-weight: 500;
}
.eng-ring { transform-origin: center; }
html[data-motion='1'] .eng-ring { animation: engspin 26s linear infinite; transform-box: fill-box; }
@keyframes engspin { to { transform: rotate(360deg); } }

.hw-engine__claim {
  margin-top: 14px; padding: 13px 15px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--dline); border-radius: 9px;
}
.hw-engine__claim-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hw-engine__slot { font-size: 0.7rem; color: var(--snow-muted); letter-spacing: 0.02em; }
.hw-engine__state {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; border: 1px solid var(--dline-2); color: var(--snow-muted);
  transition: color .4s ease, border-color .4s ease;
  flex: none;
}
.hw-engine__state.is-unknown { color: var(--snow-faint); }
.hw-engine__state.is-inferred { color: #c9b6f0; border-color: rgba(201,182,240,0.4); }
.hw-engine__state.is-evidenced { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 50%, transparent); }
.hw-engine__claim-text {
  margin-top: 9px; font-size: 0.86rem; line-height: 1.5; color: var(--snow);
  opacity: 0; transition: opacity .6s ease; min-height: 2.6em; text-wrap: pretty;
}

/* utility */
.stack > * + * { margin-top: var(--s, 16px); }
.muted { color: var(--muted); }
.dark .muted { color: var(--snow-muted); }
.center { text-align: center; }
.flex { display: flex; }
.between { justify-content: space-between; }
.aic { align-items: center; }
.wrap-gap { flex-wrap: wrap; gap: 12px; }
