/* =============================================================
   Carve website — Harbor design system
   Single shared stylesheet for index.html + ai-team.html.
   Tokens + base type from the handoff (colors_and_type.css),
   components adapted from kit.css to the live markup.
   Note: focus glow uses the teal value rgba(14,110,110,.18)
   (the kit.css copy still carried the old orange — corrected here).
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---------- Brand palette · HARBOR ---------- */
  --ink-900: #15191C;
  --ink-800: #20262B;
  --ink-600: #444E54;
  --ink-400: #828D94;
  --ink-200: #D2D9DD;
  --ink-100: #E4EAED;

  --paper:   #F5F7F8;
  --paper-2: #E9EDEF;
  --paper-3: #DFE4E7;
  --white:   #FFFFFF;

  --accent-600: #0A5454;
  --accent-500: #0E6E6E;
  --accent-400: #2F9090;
  --accent-100: #D7EAE9;

  --slate-700: #2B3A44;
  --slate-500: #5A6B76;
  --slate-200: #C7D0D6;

  --success: #2F6F4E;
  --warning: #B5861F;
  --danger:  #9A3A2A;
  --info:    #2B3A44;

  /* fg / bg semantics */
  --bg-1: var(--paper);
  --bg-2: var(--paper-2);
  --bg-3: var(--paper-3);
  --bg-inverse: var(--ink-900);

  --fg-1: var(--ink-900);
  --fg-2: var(--ink-600);
  --fg-3: var(--ink-400);
  --fg-inverse: var(--paper);

  --border-1: var(--ink-200);
  --border-2: var(--ink-100);
  --border-strong: var(--ink-900);

  --link: var(--ink-900);
  --link-accent: var(--accent-500);

  /* light-on-ink overlays (cool paper tint) */
  --on-ink-1: rgba(245, 247, 248, 0.92);
  --on-ink-2: rgba(245, 247, 248, 0.78);
  --on-ink-3: rgba(245, 247, 248, 0.60);
  --on-ink-line: rgba(245, 247, 248, 0.18);
  --on-ink-fill: rgba(245, 247, 248, 0.05);

  /* type */
  --font-display: 'Fraunces', 'Tiempos Headline', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-text:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', Menlo, Consolas, monospace;

  --fs-display:  clamp(56px, 7vw, 112px);
  --fs-h1:       clamp(40px, 4.4vw, 64px);
  --fs-h2:       clamp(30px, 3.2vw, 44px);
  --fs-h3:       24px;
  --fs-h4:       19px;
  --fs-lead:     20px;
  --fs-body:     16px;
  --fs-small:    14px;
  --fs-caption:  12px;
  --fs-eyebrow:  12px;

  --lh-tight:    1.02;
  --lh-snug:     1.15;
  --lh-normal:   1.45;
  --lh-loose:    1.6;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0em;
  --tracking-wide:   0.14em;

  /* spacing (4px base) */
  --sp-0: 0;  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;

  /* radii */
  --r-0: 0px; --r-1: 2px; --r-2: 4px; --r-3: 8px; --r-pill: 999px;

  /* elevation */
  --shadow-1: 0 1px 0 rgba(17,17,17,0.06);
  --shadow-2: 0 1px 2px rgba(17,17,17,0.06), 0 2px 8px rgba(17,17,17,0.04);
  --shadow-3: 0 2px 6px rgba(17,17,17,0.08), 0 12px 28px -10px rgba(17,17,17,0.12);
  --hairline: inset 0 0 0 1px var(--border-1);

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --dur-4: 560ms;

  /* layout */
  --max-w: 1200px;
  --max-w-prose: 68ch;
  --gutter: clamp(16px, 4vw, 40px);

  --focus-glow: 0 0 0 3px rgba(14, 110, 110, 0.18);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 88px;
}
body {
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-feature-settings: 'ss01','cv11';
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
::selection { background: var(--accent-500); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding: var(--sp-9) 0; }
.section--tight { padding: var(--sp-8) 0; }
.section--ink { background: var(--ink-900); color: var(--paper); }
.divider { border-top: 1px solid var(--border-1); }

/* ---------- Typographic primitives ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-2); margin-bottom: var(--sp-5);
}
.eyebrow::before {
  content: ""; display: inline-block;
  width: 40px; height: 1px; background: var(--accent-500);
}
.eyebrow--light { color: var(--on-ink-3); }
.eyebrow--light::before { background: var(--accent-400); }
.eyebrow--center { justify-content: center; }

.dot { color: var(--accent-500); font-style: normal; }

.display {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(44px, 6.5vw, 96px); line-height: var(--lh-tight);
  letter-spacing: -0.025em; text-wrap: balance;
  font-variation-settings: "opsz" 144;
  max-width: 18ch;
}
.h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-h1); line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight); text-wrap: balance;
  font-variation-settings: "opsz" 96;
}
.h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-h2); line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight); text-wrap: balance;
  font-variation-settings: "opsz" 48;
  max-width: 22ch;
}
.h2--light { color: var(--paper); }
.h3 {
  font-family: var(--font-text); font-weight: 600;
  font-size: var(--fs-h3); line-height: var(--lh-snug);
  letter-spacing: -0.01em;
}
.lead {
  font-size: var(--fs-lead); line-height: 1.5;
  color: var(--fg-2); max-width: 62ch;
}
.lead--light { color: var(--on-ink-2); }
.body {
  font-size: var(--fs-body); line-height: var(--lh-loose);
  color: var(--fg-2); max-width: var(--max-w-prose);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 15px/1 var(--font-text); letter-spacing: -0.005em;
  padding: 14px 20px; border: 0; border-radius: var(--r-1);
  cursor: pointer; text-decoration: none;
  transition: background var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn .arrow { transition: transform var(--dur-2) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--primary { background: var(--ink-900); color: var(--paper); }
.btn--primary:hover { background: var(--ink-800); }
.btn--primary:active { transform: scale(0.99); }
.btn--primary-light { background: var(--paper); color: var(--ink-900); }
.btn--primary-light:hover { background: var(--white); }
.btn--text {
  background: transparent; color: var(--ink-900); padding: 8px 0;
  text-decoration: underline; text-decoration-color: var(--accent-500);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.btn--text:hover { text-decoration-color: var(--ink-900); }
.btn--text-light { color: var(--paper); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease-out);
}
.nav--scrolled { border-bottom-color: var(--border-1); }
.nav__brand {
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; letter-spacing: -0.02em;
  color: var(--ink-900); text-decoration: none;
  font-variation-settings: "opsz" 40;
}
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a {
  color: var(--fg-1); text-decoration: none;
  font-size: 15px; font-weight: 500;
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.nav__links a:hover { border-bottom-color: var(--accent-500); }
.nav__links a.nav__cta { color: var(--ink-900); font-weight: 600; }
.nav__toggle {
  display: none; flex-direction: column; gap: 4px;
  background: transparent; border: 0; padding: 8px; cursor: pointer;
}
.nav__toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink-900); }

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start;
    background: var(--paper);
    border-bottom: 1px solid var(--border-1);
    padding: 16px var(--gutter) 24px; gap: 16px;
    display: none;
  }
  .nav__links[data-open="true"] { display: flex; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--sp-10) 0 var(--sp-9); }
.hero__headline { margin-bottom: var(--sp-6); }
.hero__sub { font-size: var(--fs-lead); color: var(--fg-2); max-width: 60ch; margin-bottom: var(--sp-4); }
.hero__body { margin-bottom: var(--sp-7); }
.hero__ctas { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* staggered reveal on load */
.reveal { opacity: 0; transform: translateY(12px); animation: reveal var(--dur-4) var(--ease-out) forwards; }
.reveal-1 { animation-delay: 60ms; }
.reveal-2 { animation-delay: 140ms; }
.reveal-3 { animation-delay: 220ms; }
.reveal-4 { animation-delay: 300ms; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Prose section (single column blocks) ---------- */
.prose-block { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-8); align-items: start; }
.prose-block__aside { position: sticky; top: 96px; }
@media (max-width: 820px) {
  .prose-block { grid-template-columns: 1fr; gap: var(--sp-5); }
  .prose-block__aside { position: static; }
}

/* ---------- Services (interactive list + panel) ---------- */
.services { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: start; margin-top: var(--sp-7); }
.services__list { list-style: none; border-top: 1px solid var(--border-1); }
.services__item {
  width: 100%; display: flex; align-items: baseline; gap: 16px;
  background: transparent; border: 0; border-bottom: 1px solid var(--border-1);
  padding: 18px 0; cursor: pointer; text-align: left;
  font: 500 17px/1.3 var(--font-text); color: var(--fg-2);
  transition: color var(--dur-2) var(--ease-out);
}
.services__item:hover { color: var(--fg-1); }
.services__item.is-active { color: var(--ink-900); }
.services__item.is-active .services__num { color: var(--accent-500); }
.services__num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); width: 28px; flex-shrink: 0; }
.services__label { flex: 1; }
.services__panel { display: none; max-width: 620px; }
.services__panel.is-active { display: block; animation: ck-fade var(--dur-3) var(--ease-out); }
.services__panel .tag {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent-500); margin-bottom: var(--sp-4);
}
.services__panel h3 { margin-bottom: var(--sp-4); }
@keyframes ck-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) {
  .services { grid-template-columns: 1fr; gap: 32px; }
  .services__panel { display: block; padding-top: var(--sp-4); }
  .services__panel:not(.is-active) { display: none; }
}

/* ---------- Steps (how we work) ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: var(--sp-7); }
.step { padding-top: var(--sp-5); border-top: 1px solid var(--border-1); }
.step__num { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--accent-500); margin-bottom: var(--sp-4); }
.step h3 { margin-bottom: var(--sp-3); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Card grid (about / team) ---------- */
.cards { display: grid; gap: 20px; margin-top: var(--sp-7); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--auto { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  background: var(--paper); padding: 32px; border-radius: var(--r-1);
  box-shadow: var(--hairline);
  transition: box-shadow var(--dur-2) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-2); }
.card h3 { margin-bottom: var(--sp-3); }
.card h3 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border-1); transition: border-color var(--dur-2) var(--ease-out); }
.card h3 a:hover { border-bottom-color: var(--accent-500); }
.card__link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: var(--sp-4);
  font-size: 14px; font-weight: 600; color: var(--ink-900); text-decoration: none;
  border-bottom: 1px solid var(--accent-500); padding-bottom: 2px;
}
.card__link .arrow { transition: transform var(--dur-2) var(--ease-out); }
.card__link:hover .arrow { transform: translateX(3px); }
@media (max-width: 720px) { .cards--2 { grid-template-columns: 1fr; } }

/* ---------- Clients (hairline grid) ---------- */
.clients {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-1); border-left: 1px solid var(--border-1);
  margin-top: var(--sp-7);
}
.client {
  display: flex; align-items: center; justify-content: center;
  padding: 36px 20px; min-height: 120px;
  border-right: 1px solid var(--border-1); border-bottom: 1px solid var(--border-1);
  transition: background var(--dur-2) var(--ease-out);
}
.client:hover { background: var(--paper-2); }
.client img {
  height: 48px; width: auto; max-width: 140px; object-fit: contain;
  filter: grayscale(1); opacity: 0.55;
  transition: opacity var(--dur-2) var(--ease-out), filter var(--dur-2) var(--ease-out);
}
.client:hover img { opacity: 0.95; filter: grayscale(0.2); }
@media (max-width: 720px) { .clients { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Contact (ink section) ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact__direct { color: var(--on-ink-2); font-size: 15px; margin-top: var(--sp-6); line-height: 1.8; }
.contact__direct a {
  color: var(--paper); text-decoration: underline;
  text-decoration-color: var(--accent-400); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.contact__direct a:hover { text-decoration-color: var(--paper); }
.contact__panel {
  background: var(--on-ink-fill); box-shadow: inset 0 0 0 1px var(--on-ink-line);
  border-radius: var(--r-1); padding: 36px;
}
.contact__panel .label { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-ink-3); margin-bottom: var(--sp-3); }
.contact__email {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.01em; color: var(--paper); text-decoration: none; word-break: break-word;
  border-bottom: 1px solid var(--on-ink-line); padding-bottom: 4px;
  transition: border-color var(--dur-2) var(--ease-out);
}
.contact__email:hover { border-bottom-color: var(--accent-400); }
.contact__cta { margin-top: var(--sp-6); }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- Footer ---------- */
.footer { padding: var(--sp-8) 0 var(--sp-6); background: var(--paper); border-top: 1px solid var(--border-1); }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: var(--sp-6); border-bottom: 1px solid var(--border-1); }
.footer__brand { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--ink-900); text-decoration: none; }
.footer__tagline { margin-top: var(--sp-3); font-size: 14px; color: var(--fg-3); max-width: 34ch; line-height: 1.6; }
.footer__col .eyebrow { margin-bottom: var(--sp-4); }
.footer__col a { display: block; color: var(--fg-1); text-decoration: none; font-size: 14px; padding: 5px 0; transition: color var(--dur-2) var(--ease-out); }
.footer__col a:hover { color: var(--accent-500); }
.footer__legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: var(--sp-5); font-size: 13px; color: var(--fg-3); }
@media (max-width: 720px) { .footer__top { grid-template-columns: 1fr; gap: 28px; } }
