/* ===========================================================
   Tech Sage — shared stylesheet
   Aesthetic: warm editorial / refined-technical
   Paper + ink + sage, Fraunces display, Hanken Grotesk body,
   JetBrains Mono technical labels.
   =========================================================== */

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

:root {
  --paper: #F4F1E8;
  --paper-2: #EDE8DB;
  --ink: #17201B;
  --ink-soft: #3D4A40;
  --ink-faint: #6B7568;
  --sage: #5C7355;
  --sage-deep: #3C4E38;
  --sage-bright: #84A074;
  --clay: #B5623C;
  --line: #D4CDBC;
  --white: #FCFAF4;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, .display {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 500;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand .leaf { color: var(--sage); font-size: 1.1rem; }
.brand small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
  align-self: center;
}
.nav-links { display: flex; align-items: center; gap: 38px; }
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1.5px;
  background: var(--sage);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  font-family: 'Hanken Grotesk';
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  transition: all 0.25s var(--ease);
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.nav-cta::after { display: none; }

.menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 30px; height: 22px; position: relative;
}
.menu-btn span {
  position: absolute; left: 0; height: 2px; width: 100%;
  background: var(--ink); transition: 0.3s var(--ease);
}
.menu-btn span:nth-child(1) { top: 0; }
.menu-btn span:nth-child(2) { top: 10px; }
.menu-btn span:nth-child(3) { top: 20px; }
.menu-btn.open span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Hanken Grotesk';
  font-weight: 600;
  font-size: 0.98rem;
  padding: 15px 28px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.28s var(--ease);
  border: 1.5px solid var(--ink);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--sage-deep); border-color: var(--sage-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { transition: transform 0.28s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 110px 0 90px; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 75% 30%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 75% 30%, #000 0%, transparent 75%);
  opacity: 0.55;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-eyebrow { margin-bottom: 26px; }
.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  max-width: 14ch;
  margin-bottom: 30px;
}
.hero h1 em { font-style: italic; color: var(--sage); }
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 54ch;
  margin-bottom: 42px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* staggered load */
.reveal { opacity: 0; transform: translateY(22px); animation: rise 0.9s var(--ease) forwards; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.31s; }
.d4 { animation-delay: 0.44s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ---------- Section scaffolding ---------- */
section { position: relative; z-index: 2; }
.section { padding: 86px 0; }
.section-head { max-width: 60ch; margin-bottom: 56px; }
.section-head .mono { display: block; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 18px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.divider { height: 1px; background: var(--line); }

/* statement band */
.statement { background: var(--sage-deep); color: var(--paper); }
.statement .wrap { padding-top: 78px; padding-bottom: 78px; }
.statement .mono { color: var(--sage-bright); }
.statement p {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.3;
  font-weight: 400;
  max-width: 26ch;
  margin-top: 22px;
}
.statement p strong { color: var(--sage-bright); font-weight: 500; }

/* capability cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); }
.card {
  padding: 38px 36px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  transition: background 0.3s var(--ease);
}
.cards .card:nth-child(2n) { border-right: none; }
.cards .card:nth-child(n+3) { border-bottom: none; }
.card:hover { background: var(--white); }
.card .num { font-family: 'JetBrains Mono'; font-size: 0.78rem; color: var(--sage); margin-bottom: 22px; }
.card h3 { font-size: 1.4rem; margin-bottom: 12px; }
.card p { font-size: 0.98rem; color: var(--ink-soft); line-height: 1.6; }

/* service rows */
.srow { display: grid; grid-template-columns: 0.9fr 1.4fr; gap: 48px; padding: 54px 0; border-top: 1px solid var(--line); align-items: start; }
.srow:last-child { border-bottom: 1px solid var(--line); }
.srow .mono { display: block; margin-bottom: 14px; }
.srow h3 { font-size: 1.8rem; line-height: 1.1; }
.srow p { color: var(--ink-soft); font-size: 1.05rem; }

/* approach list */
.approach { display: grid; gap: 0; }
.approach .item { padding: 34px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 0.5fr 1.5fr; gap: 36px; align-items: baseline; }
.approach .item:last-child { border-bottom: 1px solid var(--line); }
.approach h3 { font-size: 1.45rem; }
.approach p { color: var(--ink-soft); }

/* focus list */
.focus { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--line); }
.focus li { padding: 20px 4px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; font-size: 1rem; }
.focus li::before { content: "→"; color: var(--sage); font-family: 'JetBrains Mono'; }

/* CTA band */
.cta-band { background: var(--ink); color: var(--paper); }
.cta-band .wrap { padding: 80px 32px; text-align: center; }
.cta-band .mono { color: var(--sage-bright); }
.cta-band h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 18px auto 14px; max-width: 18ch; }
.cta-band p { color: color-mix(in srgb, var(--paper) 75%, transparent); margin-bottom: 36px; }
.cta-band .btn-primary { background: var(--sage); border-color: var(--sage); color: var(--white); }
.cta-band .btn-primary:hover { background: var(--sage-bright); border-color: var(--sage-bright); color: var(--ink); }

/* about hero */
.about-hero { padding: 96px 0 40px; }
.about-hero .grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 60px; align-items: center; }
.about-hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 20px 0 26px; }
.about-hero p { color: var(--ink-soft); font-size: 1.12rem; margin-bottom: 18px; }
.portrait {
  aspect-ratio: 3/4;
  background: linear-gradient(155deg, var(--sage-deep), var(--ink));
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end; padding: 28px;
}
.portrait::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
.portrait .tag { position: relative; z-index: 2; color: var(--paper); font-family: 'JetBrains Mono'; font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; }
.portrait .tag b { display:block; font-family:'Fraunces'; font-size: 1.4rem; letter-spacing: normal; text-transform: none; margin-top: 6px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; align-items: start; }
.field { margin-bottom: 22px; }
.field label { display: block; font-family: 'JetBrains Mono'; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%;
  font-family: 'Hanken Grotesk';
  font-size: 1rem;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); }
.field textarea { resize: vertical; min-height: 140px; }
.contact-info { border-left: 1px solid var(--line); padding-left: 40px; }
.contact-info .row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-info .row:first-child { padding-top: 0; }
.contact-info .row .mono { display: block; margin-bottom: 5px; }
.contact-info .row a, .contact-info .row span { font-size: 1.05rem; color: var(--ink); word-break: break-word; }
.contact-info .row a:hover { color: var(--sage); }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: color-mix(in srgb, var(--paper) 72%, transparent); padding: 56px 0 40px; }
.foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.foot .brand { color: var(--paper); margin-bottom: 14px; }
.foot .brand small { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.foot-col p { font-size: 0.92rem; max-width: 40ch; }
.foot-links { display: flex; flex-direction: column; gap: 10px; }
.foot-links a { font-size: 0.92rem; color: color-mix(in srgb, var(--paper) 78%, transparent); transition: color 0.2s; }
.foot-links a:hover { color: var(--sage-bright); }
.foot-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.1); font-family: 'JetBrains Mono'; font-size: 0.7rem; letter-spacing: 0.1em; color: color-mix(in srgb, var(--paper) 50%, transparent); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: 76px 0 auto 0;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 16px 32px; width: 100%; font-size: 1.05rem; }
  .nav-links a::after { display: none; }
  .nav-links .nav-cta { margin: 12px 32px; text-align: center; }
  .menu-btn { display: block; }
  .cards { grid-template-columns: 1fr; }
  .cards .card { border-right: none; }
  .cards .card:nth-child(3) { border-bottom: 1px solid var(--line); }
  .srow, .about-hero .grid, .contact-grid, .approach .item, .focus { grid-template-columns: 1fr; gap: 16px; }
  .about-hero .grid { gap: 36px; }
  .portrait { max-width: 320px; }
  .contact-info { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 30px; }
  .focus { grid-template-columns: 1fr; }
  .approach .item { gap: 8px; padding: 26px 0; }
  .wrap { padding: 0 22px; }
  .section { padding: 60px 0; }
}
