/* ==========================================================
   Palette (from palette (1).scss)
   ========================================================== */
:root {
  --white:          #FEFEFE;
  --white-smoke:    #F2F2F2;
  --alabaster:      #E4E3E0;
  --cool-steel:     #919B9D;
  --shadow-grey:    #242223;
  --black:          #241E19;   /* espresso deep — headings */

  /* espresso tone set */
  --espresso:       #382F28;   /* buttons, dark UI  */
  --espresso-soft:  #4A3F36;   /* button hover      */
  --taupe:          #7A6E63;   /* labels, accents   */
  --taupe-line:     #CFC8C0;   /* decor strokes     */

  --accent:         var(--taupe);
  --accent-deep:    var(--espresso-soft);
  --accent-2:       var(--taupe-line);

  --bg:             var(--white);
  --bg-alt:         var(--white-smoke);
  --ink:            var(--espresso);
  --ink-soft:       #6E6259;
  --muted:          #857C71;
  --line:           #E5E2DD;

  --font-display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --container: 1160px;
  --radius: 2px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================
   Reset / base
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

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

::selection { background: var(--espresso); color: var(--white); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================
   Typography helpers
   ========================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 20px;
}

.serif-accent {
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
  letter-spacing: inherit;
  color: var(--accent);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(30px, 4.2vw, 46px);
}

.section-head .side-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s;
}

.section-head .side-link:hover { color: var(--accent); border-color: var(--accent); }

section { padding: 104px 0; position: relative; overflow: hidden; }

section > .container { position: relative; z-index: 1; }

.section-alt { background: #F1EFEC; }

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 15px 34px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translate(2px, -2px); }

.btn-primary {
  background: var(--espresso);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================
   Header / nav
   ========================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(254, 254, 254, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.site-header.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--black);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.logo .logo-role {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--black); }

.nav-cta {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--white) !important;
  background: var(--espresso);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  transition: background 0.25s !important;
}
.nav-cta:hover { background: var(--accent-deep); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px; height: 40px;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: var(--black);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================
   Decorative shapes
   ========================================================== */
.decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* circuit-trace line-work — diagonal traces, rounded bends, vias, target ring */
.decor-net {
  width: 460px;
  height: 360px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 460 360'%3E%3Cg fill='none' stroke='%23D8D2CA' stroke-width='1'%3E%3Cpath d='M-10 252 L118 124 Q126 116 137 116 H238'/%3E%3Cpath d='M238 116 l-10 -5 M238 116 l-10 5'/%3E%3Cpath d='M-10 292 L136 146 Q144 138 155 138 H198 Q206 138 206 130 V96'/%3E%3Cpath d='M64 360 L226 208 Q234 200 234 189 V132'/%3E%3Cpath d='M258 330 L344 244' stroke-dasharray='3 7'/%3E%3Cpath d='M344 244 H418'/%3E%3Crect x='372' y='236' width='9' height='9' transform='rotate(45 376.5 240.5)'/%3E%3Ccircle cx='340' cy='96' r='42'/%3E%3Cpath d='M284 96 H396 M340 40 V152'/%3E%3Cpath d='M428 24 L386 66 M386 66 l3 -12 M386 66 l12 -3'/%3E%3Cpath d='M296 196 l9 9 m-2 -16 l9 9 m-2 -16 l9 9'/%3E%3C/g%3E%3Cg fill='none' stroke='%23A79C8F'%3E%3Ccircle cx='206' cy='90' r='5'/%3E%3Ccircle cx='86' cy='308' r='14'/%3E%3Ccircle cx='340' cy='96' r='9'/%3E%3C/g%3E%3Cg fill='%23B7AEA3'%3E%3Ccircle cx='234' cy='126' r='3.5'/%3E%3Ccircle cx='424' cy='244' r='3'/%3E%3Ccircle cx='258' cy='330' r='2.5'/%3E%3Ccircle cx='86' cy='308' r='2.5'/%3E%3Ccircle cx='340' cy='96' r='2.5'/%3E%3Ccircle cx='118' cy='124' r='2'/%3E%3Ccircle cx='136' cy='146' r='2'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
}

.decor-net-sm {
  width: 320px;
  height: 260px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 260'%3E%3Cg fill='none' stroke='%23D8D2CA' stroke-width='1'%3E%3Cpath d='M-10 180 L104 66 Q112 58 123 58 H194'/%3E%3Cpath d='M194 58 l-10 -5 M194 58 l-10 5'/%3E%3Cpath d='M-10 224 L120 94'/%3E%3Cpath d='M120 94 L166 48' stroke-dasharray='3 7'/%3E%3Cpath d='M60 260 L150 170 Q158 162 169 162 H218'/%3E%3Cpath d='M226 160 H282'/%3E%3Cpath d='M236 108 l8 8 m-2 -14 l8 8 m-2 -14 l8 8'/%3E%3C/g%3E%3Cg fill='none' stroke='%23A79C8F'%3E%3Ccircle cx='210' cy='160' r='16'/%3E%3Ccircle cx='224' cy='162' r='5'/%3E%3C/g%3E%3Cg fill='%23B7AEA3'%3E%3Ccircle cx='120' cy='94' r='2.5'/%3E%3Ccircle cx='286' cy='160' r='3'/%3E%3Ccircle cx='210' cy='160' r='2.5'/%3E%3Ccircle cx='104' cy='66' r='2'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
}

@media (max-width: 960px) {
  .decor { display: none; }
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  padding: 190px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: 500;
  max-width: 17ch;
  margin-bottom: 30px;
}

.hero-summary {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 54ch;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 0;
  margin-top: 88px;
  border-top: 1px solid var(--line);
}

.stat {
  flex: 1;
  padding: 28px 32px 0 0;
}
.stat + .stat { padding-left: 32px; border-left: 1px solid var(--line); }

.stat .stat-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--black);
  letter-spacing: -0.02em;
}
.stat .stat-num em {
  font-style: normal;
  color: var(--accent);
}
.stat .stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ==========================================================
   About
   ========================================================== */
.about-copy h2 {
  font-size: clamp(30px, 4.2vw, 46px);
  margin-bottom: 28px;
}

.about-copy p {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 58ch;
}
.about-copy p + p { margin-top: 18px; }

.about-meta {
  display: flex;
  gap: 48px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.about-meta div span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.about-meta div strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--black);
}

/* ==========================================================
   What I Do — cards
   ========================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  background: var(--bg);
  padding: 44px 40px 48px;
  transition: background 0.3s var(--ease);
  position: relative;
}

.card:hover { background: var(--bg-alt); }

.card .card-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 44px;
}

.card h3 {
  font-size: 21px;
  margin-bottom: 14px;
}

.card p {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 44ch;
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}
.card:hover::before { width: 100%; }

/* ==========================================================
   Career teaser band
   ========================================================== */
.band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band h3 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
}
.band p { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }

/* ==========================================================
   Contact
   ========================================================== */
.contact {
  padding: 130px 0 120px;
  position: relative;
  overflow: hidden;
}
.contact .container { position: relative; z-index: 1; }

.contact h2 {
  font-size: clamp(40px, 6vw, 68px);
  max-width: 16ch;
  margin-bottom: 28px;
}

.contact-lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 48px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
  max-width: 560px;
}

.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--black);
  transition: padding-left 0.3s var(--ease), color 0.25s;
}

.contact-links a span.kind {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-links a:hover { color: var(--accent); padding-left: 12px; }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer p {
  font-size: 13px;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  gap: 24px;
}
.footer-nav a {
  font-size: 13px;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--black); }

/* ==========================================================
   Page hero (inner pages)
   ========================================================== */
.page-hero {
  padding: 180px 0 72px;
  position: relative;
  overflow: hidden;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
  font-size: clamp(36px, 5.4vw, 62px);
  max-width: 18ch;
  margin-bottom: 22px;
}
.page-hero .lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ==========================================================
   Timeline (career page)
   ========================================================== */
.timeline { padding: 40px 0 120px; }

.tl-company {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.tl-company:last-child { border-bottom: 1px solid var(--line); }

.tl-company-info .tl-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 18px;
}

.tl-company-info h3 {
  font-size: 24px;
  margin-bottom: 6px;
}

.tl-company-info .tl-span {
  font-size: 13px;
  color: var(--muted);
}

.tl-roles {
  position: relative;
  padding-left: 32px;
}

.tl-roles::before {
  content: "";
  position: absolute;
  left: 4px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--line);
}

.tl-role {
  position: relative;
  padding-bottom: 36px;
}
.tl-role:last-child { padding-bottom: 0; }

.tl-role::before {
  content: "";
  position: absolute;
  left: -32px; top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-role h4 {
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.tl-role .tl-dates {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.tl-role p {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 60ch;
}

/* ==========================================================
   Work page (unlisted)
   ========================================================== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-bottom: 120px;
}

.case {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.3s;
}
.case[open], .case:hover { border-color: var(--cool-steel); }

.case summary {
  list-style: none;
  cursor: pointer;
  padding: 34px 36px;
}
.case summary::-webkit-details-marker { display: none; }

.case .case-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}

.case h3 { font-size: 20px; margin-bottom: 6px; }

.case .case-game {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
}

.case .case-result {
  font-size: 15px;
  color: var(--ink-soft);
}

.case .case-toggle-hint {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.case summary:hover .case-toggle-hint { color: var(--accent); }
.case[open] .case-toggle-hint .closed-label { display: none; }
.case:not([open]) .case-toggle-hint .open-label { display: none; }

.case-body {
  padding: 0 36px 36px;
  border-top: 1px solid var(--line);
}

.case-body dl { margin-top: 26px; }
.case-body dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.case-body dd {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.case-body dd:last-child { margin-bottom: 0; }

/* ==========================================================
   Reveal animation
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 960px) {
  section { padding: 80px 0; }

  .tl-company { grid-template-columns: 1fr; gap: 32px; padding: 44px 0; }

  .work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 24px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .nav-links.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 0; font-size: 16px; }
  .nav-links .nav-cta { display: inline-block; margin-top: 10px; padding: 12px 24px; }

  .hero { padding: 150px 0 72px; }

  .hero-stats { flex-direction: column; border-top: none; margin-top: 56px; }
  .stat { padding: 20px 0; border-top: 1px solid var(--line); }
  .stat + .stat { padding-left: 0; border-left: none; }

  .cards-grid { grid-template-columns: 1fr; }
  .card { padding: 36px 28px 40px; }

  .band { flex-direction: column; align-items: flex-start; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 40px; }

  .about-meta { flex-wrap: wrap; gap: 24px; }

  .case summary { padding: 26px 24px; }
  .case-body { padding: 0 24px 28px; }
}
