/* ============ Tokens ============ */
:root {
  --bg: #ffffff;
  --ink: #1b1b1b;
  --muted: #666666;
  --faint: #9a9a9a;
  --line: #ececec;
  --surface: #f6f6f4;
  --display: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 360px;
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: normal; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid #2f5bea; outline-offset: 3px; border-radius: 4px; }

.label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; }
.sidebar-inner {
  height: 100%; display: flex; flex-direction: column; gap: 22px;
  padding: 40px 36px 32px 48px; overflow-y: auto;
}
.locale { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.locale-dot { color: #22a35a; font-size: 9px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.identity { margin-top: 48px; }
.name { font: 700 clamp(48px, 5.2vw, 66px)/.95 var(--display); letter-spacing: -.045em; }
.name a { text-decoration: none; }
.name-sub { margin-top: 10px; font: 500 16px/1 var(--display); color: var(--muted); letter-spacing: -.01em; display: flex; gap: 10px; align-items: center; }
.name-sub span { color: var(--line); letter-spacing: -2px; }

.bio { font-size: 15px; max-width: 26ch; }
.bio + .bio { margin-top: -14px; }
.company { display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; font-weight: 500; }
.company:hover { text-decoration-color: var(--ink); }
.company-logo { width: 18px; height: 18px; border-radius: 50%; background: #ffcc33; color: #1b1b1b; font-size: 10px; font-weight: 600; display: inline-grid; place-items: center; text-decoration: none; }

.side-nav a, .side-contact a {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 0;
  font-size: 13px; color: var(--muted); text-decoration: none; transition: color .2s;
}
.side-nav a:hover, .side-contact a:hover { color: var(--ink); }
.side-nav a.is-active { color: var(--ink); }
.side-nav a.is-active::before { content: ""; width: 14px; height: 1px; background: currentColor; }
.side-contact svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.copyright { margin-top: auto; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

.main { padding: 40px 40px 80px 8px; min-width: 0; }

/* ============ Stacked cards ============ */
.stack { display: flex; flex-direction: column; gap: 28px; }
.card {
  position: sticky; top: calc(40px + var(--i) * 16px);
  border-radius: var(--radius); background: var(--card); color: #fff;
  box-shadow: 0 -1px 0 rgba(255,255,255,.08) inset, 0 20px 40px -24px rgba(0,0,0,.35);
  overflow: hidden;
}
.card-link { display: flex; flex-direction: column; min-height: min(78vh, 720px); padding: 18px 28px 0; text-decoration: none; color: inherit; }
.card-top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .04em; opacity: .75; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 18px; }
.card-title { font: 700 clamp(26px, 3vw, 38px)/1.05 var(--display); letter-spacing: -.035em; }
.card-desc { margin-top: 8px; max-width: 60ch; font-size: 14px; opacity: .85; }
.card-arrow { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; border: 1px solid rgba(255,255,255,.35); transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease); }
.card-link:hover .card-arrow, .card-link:focus-visible .card-arrow { background: #fff; color: var(--card); transform: rotate(-45deg); }
.card-link:focus-visible { outline: 3px solid #fff; outline-offset: -6px; border-radius: var(--radius); }

/* Media area: a lighter panel holding placeholder device mockups */
.card-media {
  position: relative; flex: 1; margin-top: 26px; min-height: 360px;
  border-radius: 12px 12px 0 0; background: rgba(255,255,255,.14);
  display: flex; align-items: flex-end; justify-content: center; gap: 28px; padding: 36px 24px 0; overflow: hidden;
}
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-link:hover .phone, .card-link:hover .panel { transform: translateY(-8px); }
.card-link:hover .phone.tilt { transform: translateY(-8px) rotate(4deg); }

.phone {
  width: 190px; height: 340px; flex: none; border-radius: 30px 30px 0 0;
  background: #fff; border: 6px solid #111; border-bottom: 0;
  padding: 26px 14px 0; display: flex; flex-direction: column; gap: 10px;
  transition: transform .5s var(--ease); box-shadow: 0 20px 40px -10px rgba(0,0,0,.35);
}
.phone.tilt { transform: rotate(4deg); margin-bottom: -30px; }
.panel {
  width: min(460px, 80%); height: 300px; border-radius: 14px 14px 0 0; background: #fff;
  padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: transform .5s var(--ease);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.35);
}
.panel.wide { width: min(620px, 92%); }
.phone > span, .panel > span { display: block; border-radius: 6px; background: #ececec; }
.ph-bar { height: 8px; width: 40%; background: #dcdcdc !important; }
.ph-hero { height: 110px; background: color-mix(in srgb, var(--card) 22%, #fff) !important; }
.ph-hero.alt { height: 140px; background: color-mix(in srgb, var(--card) 40%, #fff) !important; }
.ph-row { height: 12px; }
.ph-row.short { width: 60%; }
.ph-btn { height: 34px; margin-top: auto; margin-bottom: 18px; background: var(--card) !important; border-radius: 999px !important; }
.ph-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; background: none !important; }
.ph-grid i { height: 54px; border-radius: 8px; background: #f0f0f0; }
.panel-chart { flex: 1; display: flex !important; align-items: flex-end; gap: 10px; background: none !important; padding-top: 10px; }
.panel-chart i { flex: 1; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--card) 70%, #fff); }
.panel-chart i:nth-child(1) { height: 30%; } .panel-chart i:nth-child(2) { height: 45%; } .panel-chart i:nth-child(3) { height: 38%; }
.panel-chart i:nth-child(4) { height: 62%; } .panel-chart i:nth-child(5) { height: 75%; } .panel-chart i:nth-child(6) { height: 92%; background: var(--card); }

.chip {
  position: absolute; padding: 8px 12px; border-radius: 10px; background: #fff; color: #1b1b1b;
  font-size: 12px; font-weight: 500; box-shadow: 0 10px 24px -8px rgba(0,0,0,.35);
}
.chip-a { left: 10%; top: 22%; }
.chip-b { right: 10%; top: 40%; }

/* ============ Content blocks ============ */
.block { padding: 120px 8px 0; max-width: 860px; scroll-margin-top: 20px; }
.block-title { font: 700 clamp(30px, 3.6vw, 46px)/1.08 var(--display); letter-spacing: -.04em; max-width: 20ch; }
.block-title em { color: var(--muted); }

.about-grid { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-top: 40px; align-items: start; }
.portrait { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 12px; object-fit: cover; }
.portrait-ph { background: repeating-linear-gradient(135deg, var(--surface) 0 10px, #efefec 10px 20px); display: grid; place-items: center; color: var(--faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.about-copy p { color: #3a3a3a; max-width: 58ch; }
.about-copy p + p { margin-top: 14px; }
.timeline { margin-top: 28px; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li span:first-child { color: var(--faint); }
.timeline li span:last-child { color: var(--muted); }

.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.process li { background: var(--surface); border-radius: 12px; padding: 22px; }
.process .num { font: 500 24px/1 var(--display); letter-spacing: -.03em; color: var(--faint); }
.process h3 { margin-top: 18px; font-size: 15px; font-weight: 500; }
.process p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.skills h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 400; }
.skills p { margin-top: 10px; font-size: 14px; line-height: 1.8; }

.contact { padding-bottom: 40px; }
.contact-mail { display: inline-block; margin-top: 28px; font: 700 clamp(22px, 3vw, 38px)/1.15 var(--display); letter-spacing: -.035em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--line); transition: text-decoration-color .2s; word-break: break-word; }
.contact-mail:hover { text-decoration-color: var(--ink); }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.contact-links a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; text-decoration: none; transition: border-color .2s, background .2s; }
.contact-links a:hover { border-color: var(--ink); }
.mobile-copy { display: none; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  :root { --side-w: 300px; }
  .sidebar-inner { padding: 32px 24px 28px 32px; }
  .process { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; }
  .sidebar-inner { padding: 24px 16px 8px; gap: 18px; }
  .identity { margin-top: 20px; }
  .name { font-size: 60px; }
  .side-nav, .copyright { display: none; }
  .side-contact ul { display: flex; flex-wrap: wrap; gap: 0 18px; }
  .main { padding: 24px 16px 48px; }
  .card { top: calc(12px + var(--i) * 10px); }
  .card-link { min-height: 0; padding: 16px 18px 0; }
  .card-arrow { width: 38px; height: 38px; font-size: 18px; }
  .card-media { min-height: 280px; gap: 14px; padding: 28px 12px 0; }
  .phone { width: 140px; height: 250px; border-width: 5px; border-radius: 24px 24px 0 0; padding: 20px 10px 0; gap: 8px; }
  .ph-hero { height: 70px; } .ph-hero.alt { height: 90px; } .ph-grid i { height: 36px; }
  .panel { height: 230px; padding: 16px; }
  .chip { font-size: 11px; padding: 6px 10px; }
  .chip-a { left: 4%; top: 10%; } .chip-b { right: 4%; top: 30%; }
  .block { padding-top: 80px; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .portrait { max-width: 240px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .process, .skills { grid-template-columns: 1fr; }
  .mobile-copy { display: block; margin-top: 48px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
}

@media (max-width: 420px) {
  .phone.tilt { display: none; }
}

/* ============ Case-study pages ============ */
.cs { max-width: 820px; margin: 0 auto; padding: 32px 16px 96px; }
.cs-back { display: inline-flex; gap: 8px; font-size: 13px; color: var(--muted); text-decoration: none; }
.cs-back:hover { color: var(--ink); }
.cs-hero { margin-top: 40px; border-radius: var(--radius); background: var(--card); color: #fff; padding: 28px; }
.cs-hero .card-top { opacity: .75; }
.cs-title { margin-top: 18px; font: 700 clamp(36px, 5.4vw, 64px)/1.02 var(--display); letter-spacing: -.045em; }
.cs-lede { margin-top: 14px; font-size: 17px; opacity: .9; max-width: 56ch; }
.cs-cover { margin-top: 28px; aspect-ratio: 16 / 9; border-radius: 12px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cs-meta dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.cs-meta dd { margin: 6px 0 0; font-size: 14px; }
.cs-section { margin-top: 56px; }
.cs-section h2 { font: 700 28px/1.15 var(--display); letter-spacing: -.03em; }
.cs-section p { margin-top: 14px; color: #3a3a3a; max-width: 64ch; }
.cs-img { margin-top: 24px; aspect-ratio: 16 / 10; border-radius: 12px; background: repeating-linear-gradient(135deg, var(--surface) 0 10px, #efefec 10px 20px); display: grid; place-items: center; color: var(--faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.cs-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.cs-results div { background: var(--surface); border-radius: 12px; padding: 20px; }
.cs-results strong { display: block; font: 700 36px/1 var(--display); letter-spacing: -.04em; }
.cs-results span { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.cs-next { display: flex; justify-content: space-between; align-items: center; margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line); text-decoration: none; }
.cs-next span:last-child { font: 700 28px/1 var(--display); letter-spacing: -.035em; }
@media (max-width: 640px) {
  .cs-hero { padding: 20px; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-results { grid-template-columns: 1fr; }
}

/* Real company logo image in the sidebar badge */
img.company-logo { width: 20px; height: 20px; background: none; border-radius: 0; display: inline-block; flex: none; }
