/* Haku Research — theme tokens.
   Mirrors the main Haku marketing theme (same typography, ink scale, spacing)
   but swaps the primary accent from orange → jade, keeping orange as a
   secondary accent. This signals "affiliated with Haku, but its own arm". */
:root {
  /* Primary = jade */
  --accent: #0f9e74;
  --accent-deep: #0a7a59;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-tint: color-mix(in oklab, var(--accent) 6%, #ffffff);
  --accent-edge: color-mix(in oklab, var(--accent) 30%, transparent);

  /* Secondary = Haku orange */
  --accent-2: #e15024;
  --accent-2-soft: color-mix(in oklab, var(--accent-2) 12%, transparent);
  --accent-2-edge: color-mix(in oklab, var(--accent-2) 30%, transparent);

  --bg: #fbfbfa;
  --bg-elev: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #1a1a1d;
  --ink-3: #49494f;
  --ink-4: #8a8a92;
  --ink-5: #c6c6cc;
  --ink-6: #e8e8ea;
  --ink-7: #f3f3f2;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --maxw: 1180px;
  --gutter: 28px;

  --dur: 400ms;
  --ease: cubic-bezier(.2,.7,.2,1);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); font-feature-settings: 'ss01','cv11'; letter-spacing: -0.01em; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  height: 44px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 14.5px; letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn .arr { transition: transform var(--dur) var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-6); }
.btn-ghost:hover { border-color: var(--ink-3); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-family: var(--font-mono);
  background: var(--ink-7); color: var(--ink-3); border: 1px solid var(--ink-6);
}
.chip .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ink-4); }
.chip.accent { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-edge); }
.chip.accent .dot { background: var(--accent); }
.chip.accent-2 { background: var(--accent-2-soft); color: var(--accent-2); border-color: var(--accent-2-edge); }
.chip.accent-2 .dot { background: var(--accent-2); }

.card { background: var(--bg-elev); border: 1px solid var(--ink-6); border-radius: var(--r-lg); }
.rule { height: 1px; background: var(--ink-6); }

.section { padding: 104px 0; position: relative; }
.section-sm { padding: 64px 0; }
.sec-eyebrow { margin-bottom: 18px; }
.sec-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -0.035em; line-height: 1.03;
  margin: 0; max-width: 24ch;
}
.sec-lead { color: var(--ink-3); font-size: 17px; max-width: 60ch; margin: 18px 0 0; line-height: 1.6; }

/* Top bar */
.r-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--ink-6);
}
.r-nav .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.r-brand { display: flex; align-items: center; gap: 11px; }
.r-brand img { height: 26px; width: auto; display: block; }
.r-brand .sep { width: 1px; height: 20px; background: var(--ink-6); }
.r-brand .tag {
  font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.02em;
}
.r-brand .tag em { font-style: normal; color: var(--accent-deep); }
.r-nav-links { display: flex; align-items: center; gap: 26px; font-size: 14px; color: var(--ink-3); }
.r-nav-links a { transition: color 250ms; }
.r-nav-links a:hover { color: var(--ink); }

/* Hero */
.r-hero { position: relative; overflow: hidden; padding: clamp(72px, 11vw, 120px) 0 clamp(56px, 8vw, 88px); }
.r-hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.8;
  background-image:
    linear-gradient(to right, var(--ink-7) 1px, transparent 1px),
    linear-gradient(to bottom, var(--ink-7) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 30%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 30%, #000 25%, transparent 72%);
}
.r-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(38px, 5.4vw, 70px); letter-spacing: -0.04em; line-height: 0.99;
  margin: 22px 0 0; max-width: 18ch;
}
.r-hero h1 .jade { color: var(--accent); }
.r-hero .sub { font-size: 18px; color: var(--ink-3); max-width: 60ch; margin: 22px 0 0; line-height: 1.6; }
.r-hero .actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

/* Generic prose block */
.prose p { color: var(--ink-2); font-size: 17px; line-height: 1.68; margin: 0 0 18px; max-width: 70ch; }
.prose p:last-child { margin-bottom: 0; }

/* Positioning cards */
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.pos-card { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.pos-card .role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-4); }
.pos-card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.pos-card.lead { border-color: var(--accent-edge); background: var(--accent-tint); }
.pos-card.lead h3 { color: var(--accent-deep); }
.pos-card p { color: var(--ink-3); font-size: 14.5px; line-height: 1.6; margin: 0; }

/* Research questions */
.q-list { margin-top: 40px; border-top: 1px solid var(--ink-6); }
.q-row { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--ink-6); align-items: start; }
.q-row .num { font-family: var(--font-mono); color: var(--accent); font-size: 14px; padding-top: 2px; }
.q-row p { margin: 0; font-size: 17px; color: var(--ink-2); line-height: 1.55; max-width: 64ch; }

/* Applied domains */
.dom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
.dom-card { padding: 30px; }
.dom-card h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 14px 0 10px; }
.dom-card p { color: var(--ink-3); font-size: 15px; line-height: 1.62; margin: 0; }

/* Paper sequence */
.paper-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.paper-card { padding: 30px; border-color: var(--accent-edge); background: var(--accent-tint); }
.paper-card .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-deep); }
.paper-card h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.12; margin: 12px 0 14px; }
.paper-card p { color: var(--ink-2); font-size: 15px; line-height: 1.62; margin: 0; }
.seq { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.seq-item { padding: 22px; position: relative; }
.seq-item .step { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.seq-item h4 { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 12px 0 8px; line-height: 1.18; }
.seq-item p { color: var(--ink-3); font-size: 13.5px; line-height: 1.55; margin: 0; }

/* CTA band */
.r-cta { position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: var(--r-xl); padding: clamp(44px, 7vw, 80px) clamp(28px, 6vw, 72px); }
.r-cta h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.035em; line-height: 1.0; margin: 16px 0 0; max-width: 20ch; }
.r-cta h2 .jade { color: var(--accent); }
.r-cta p { color: #9a9aa3; font-size: 16.5px; max-width: 56ch; margin: 16px 0 0; line-height: 1.6; }
.r-cta .actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.r-cta .dots { position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.07) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 82% 38%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 82% 38%, #000 10%, transparent 75%);
}

/* Footer */
.r-footer { padding: 64px 0 40px; }
.r-footer .top { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--ink-6); flex-wrap: wrap; }
.r-footer .note { color: var(--ink-3); font-size: 14px; max-width: 44ch; margin: 14px 0 0; }
.r-footer .bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; color: var(--ink-4); font-size: 13px; font-family: var(--font-mono); flex-wrap: wrap; gap: 12px; }
.r-foot-links { display: flex; gap: 22px; font-size: 14px; color: var(--ink-2); font-family: var(--font-sans); }
.r-foot-links a:hover { color: var(--accent-deep); }

@media (max-width: 920px) {
  .pos-grid { grid-template-columns: 1fr; }
  .dom-grid { grid-template-columns: 1fr; }
  .paper-head { grid-template-columns: 1fr; gap: 28px; }
  .seq { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .r-nav-links { display: none; }
  .section { padding: 72px 0; }
  .seq { grid-template-columns: 1fr; }
  .q-row { grid-template-columns: 40px 1fr; gap: 14px; }
}

/* ============================================================
   Research notes (blog) — listing on the hub + article pages.
   Appended for the Notes launch. Uses the same tokens as above.
   ============================================================ */

.notes-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; }

.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.note-card {
  padding: 26px; display: flex; flex-direction: column; gap: 14px; color: inherit;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.note-card:hover { transform: translateY(-3px); border-color: var(--accent-edge); box-shadow: 0 14px 40px -24px rgba(15,158,116,0.45); }
.note-card .kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); display: flex; gap: 10px; align-items: center; }
.note-card .kicker .n { color: var(--accent-deep); }
.note-card .kicker .sep-dot { width: 4px; height: 4px; border-radius: 999px; background: var(--ink-5); display: inline-block; }
.note-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.16; margin: 0; color: var(--ink); }
.note-card p { color: var(--ink-3); font-size: 14.5px; line-height: 1.6; margin: 0; }
.note-card .more { margin-top: auto; font-family: var(--font-sans); font-size: 13.5px; color: var(--accent-deep); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.note-card .more .arr { transition: transform var(--dur) var(--ease); }
.note-card:hover .more .arr { transform: translateX(3px); }

/* ---- Article page ---- */
.article { padding: clamp(36px, 5vw, 64px) 0 clamp(56px, 8vw, 96px); }
.article .container { max-width: 768px; }

.article-back { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; color: var(--ink-4); display: inline-flex; gap: 8px; align-items: center; transition: color 250ms; }
.article-back:hover { color: var(--accent-deep); }

.article-head { margin-top: 26px; padding-bottom: 34px; border-bottom: 1px solid var(--ink-6); }
.article-head h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.04em; line-height: 1.04; margin: 18px 0 0; }
.standfirst { font-size: 19px; color: var(--ink-3); line-height: 1.6; margin: 22px 0 0; max-width: 64ch; }
.article-meta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--ink-4); letter-spacing: 0.02em; }
.article-meta .sep { color: var(--ink-5); }
.article-meta .article-tag { color: var(--accent-deep); }

.article-body { margin-top: 40px; }
.article-body > p:first-child { margin-top: 0; }
.article-body p { color: var(--ink-2); font-size: 18px; line-height: 1.74; margin: 22px 0 0; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body em { font-style: italic; }
.article-body h2 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(23px, 2.7vw, 31px);
  letter-spacing: -0.03em; line-height: 1.14; margin: 52px 0 0; color: var(--ink);
}
.article-body h2 + p { margin-top: 16px; }
.article-body blockquote { margin: 38px 0 0; padding: 6px 0 6px 28px; border-left: 3px solid var(--accent); }
.article-body blockquote p { color: var(--ink); font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.4; letter-spacing: -0.02em; margin: 0; }
.article-body ul { margin: 22px 0 0; padding-left: 22px; }
.article-body li { color: var(--ink-2); font-size: 18px; line-height: 1.7; margin: 8px 0 0; }
.article-body a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-edge); }
.article-body a:hover { text-decoration-color: var(--accent); }

.article-foot { margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--ink-6); display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.article-foot .label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-4); }
.article-foot .more { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--accent-deep); display: inline-flex; gap: 8px; align-items: center; }
.article-foot .more .arr { transition: transform var(--dur) var(--ease); }
.article-foot .more:hover .arr { transform: translateX(3px); }

@media (max-width: 920px) { .note-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .article-body p, .article-body li { font-size: 17px; }
  .notes-head { gap: 14px; }
}

/* ============================================================
   Approach section (human-grounded cognitive models) + 4-up notes.
   Appended for the Approach / Note 04 update.
   ============================================================ */

/* Notes grid: now four notes, lay out responsively. Overrides the
   earlier repeat(3,1fr) so four cards sit on one row when there is room. */
.note-grid { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }

.appr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.appr-card { padding: 22px; display: flex; flex-direction: column; gap: 11px; }
.appr-card .role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-deep); }
.appr-card p { color: var(--ink-3); font-size: 14px; line-height: 1.55; margin: 0; }

.appr-band { margin-top: 18px; padding: 30px clamp(24px, 4vw, 40px); border-color: var(--accent-edge); background: var(--accent-tint); }
.appr-band .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-deep); }
.appr-band h3 { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 28px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 0; color: var(--ink); }
.appr-band p { color: var(--ink-2); font-size: 16px; line-height: 1.66; margin: 14px 0 0; max-width: 72ch; }
.appr-band .more { margin-top: 18px; font-family: var(--font-sans); font-weight: 500; font-size: 14.5px; color: var(--accent-deep); display: inline-flex; gap: 7px; align-items: center; }
.appr-band .more .arr { transition: transform var(--dur) var(--ease); }
.appr-band .more:hover .arr { transform: translateX(3px); }

@media (max-width: 920px) { .appr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .appr-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Notes carousel (manual: arrows + drag, seamless loop, no auto-rotate)
   + Approach band dual links. Appended for the Note 05 update.
   ============================================================ */

.notes-carousel { position: relative; margin-top: 44px; padding: 0 52px; }
.notes-viewport {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  touch-action: pan-x; scroll-behavior: smooth;
}
.notes-viewport::-webkit-scrollbar { display: none; }
.notes-track { display: flex; gap: 18px; padding: 8px 2px 16px; }
.notes-track.dragging { scroll-behavior: auto; user-select: none; }
.notes-carousel .note-card { flex: 0 0 320px; cursor: grab; }
.notes-track.dragging .note-card { cursor: grabbing; }

.car-arrow {
  position: absolute; top: 46%; transform: translateY(-50%); z-index: 6;
  width: 42px; height: 42px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--ink-6); color: var(--ink-2);
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.35);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 120ms var(--ease);
}
.car-arrow:hover { border-color: var(--accent-edge); color: var(--accent-deep); }
.car-arrow:active { transform: translateY(-50%) scale(0.93); }
.car-prev { left: 6px; }
.car-next { right: 6px; }

.notes-hint { margin: 14px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-4); }

/* Approach band: two links side by side */
.appr-links { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.appr-links .more { margin-top: 0; font-family: var(--font-sans); font-weight: 500; font-size: 14.5px; color: var(--accent-deep); display: inline-flex; gap: 7px; align-items: center; }
.appr-links .more .arr { transition: transform var(--dur) var(--ease); }
.appr-links .more:hover .arr { transform: translateX(3px); }

@media (max-width: 620px) {
  .notes-carousel { padding: 0; }
  .notes-carousel .note-card { flex-basis: 80vw; }
  .car-arrow { display: none; }
  .notes-hint { text-align: center; }
}

/* ============================================================
   Carousel FIX: transform-driven, no native-scroll smooth animation.
   Overrides the earlier .notes-viewport rules. The previous
   scroll-behavior:smooth + programmatic scrollLeft made the strip
   appear to auto-rotate and fought the arrows/drag. Now JS drives a
   translateX track; CSS here keeps a native-scroll fallback for no-JS.
   ============================================================ */

.notes-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;       /* never animate the container */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.notes-viewport::-webkit-scrollbar { display: none; }

.notes-track { will-change: transform; }
.notes-track.dragging { cursor: grabbing; user-select: none; }
.notes-carousel .note-card { cursor: grab; }

/* ============================================================
   Carousel: arrows-only (drag removed). Cards are plain links,
   so the cursor is a pointer; and the arrows must show on mobile
   now that there is no swipe/drag to navigate with.
   ============================================================ */

.notes-carousel .note-card { cursor: pointer; }

@media (max-width: 620px) {
  .notes-carousel { padding: 0 6px; }
  .car-arrow { display: flex; }
}
