/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/instrument-serif-italic-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/instrument-serif-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../assets/fonts/jetbrains-mono-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../assets/fonts/space-grotesk-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  --ink: #0e0d0c;
  --bone: #f2f0ea;
  --stone: #9d9a92;
  --ash: #5f5c55;
  --line: #2a2823;
  --line-strong: #3a3833;
  --card: #1a1916;
  --pad-x: clamp(20px, 5vw, 60px);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Space Grotesk', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: clip; /* pre-reveal translateX offsets must not widen the scroll area */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bone); transition: opacity .25s ease; }
a:hover { opacity: .7; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; border-radius: 2px; }

.shell { max-width: 1280px; margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  padding: clamp(18px, 3vw, 30px) var(--pad-x);
}
.site-logo { width: clamp(64px, 7vw, 84px); height: auto; filter: invert(1); }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 28px); flex-wrap: wrap; }
.site-nav a { font-size: 14px; color: var(--stone); text-decoration: none; }
.nav-email {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  color: var(--bone) !important;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 18px;
  transition: border-color .25s ease, opacity .25s ease;
}
.nav-email:hover { border-color: var(--stone); opacity: 1; }
.nav-email-short { display: none; }

/* Narrow screens: keep the header on one row, shorten the email pill to "Partner" */
@media (max-width: 640px) {
  .site-header { flex-wrap: nowrap; }
  .site-nav { flex-wrap: nowrap; gap: 14px; }
  .nav-email { padding: 8px 14px; white-space: nowrap; }
  .nav-email-full { display: none; }
  .nav-email-short { display: inline; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 9vw, 100px) var(--pad-x) clamp(64px, 10vw, 110px);
  display: flex; flex-direction: column; gap: clamp(24px, 3.5vw, 36px);
}
.hero h1 {
  font-size: clamp(44px, 8.5vw, 104px); line-height: .98;
  font-weight: 500; letter-spacing: -.03em; max-width: 980px; text-wrap: pretty;
}
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.hero-row {
  display: flex; gap: clamp(24px, 5vw, 60px); align-items: flex-end;
  justify-content: space-between; flex-wrap: wrap;
}
.hero-intro { font-size: 18px; line-height: 1.65; color: var(--stone); max-width: 500px; text-wrap: pretty; }
.hero-meta {
  font-family: var(--mono); font-size: 12px; color: var(--ash);
  text-align: right; line-height: 1.8; max-width: 240px; text-wrap: balance;
}

/* ---------- Services ---------- */
.services { border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.service-row {
  display: flex; flex-wrap: wrap; gap: clamp(14px, 3vw, 40px); align-items: baseline;
  padding: clamp(24px, 3.5vw, 36px) var(--pad-x);
  border-bottom: 1px solid var(--line);
  transition: background-color .35s ease;
}
.service-row:hover { background-color: #141311; }
.service-num { font-family: var(--mono); font-size: 12px; color: var(--ash); flex: 0 0 clamp(28px, 12vw, 180px); }
.service-name { font-size: clamp(24px, 3vw, 32px); font-weight: 500; flex: 1 1 240px; transition: transform .35s ease; }
.service-row:hover .service-name { transform: translateX(6px); }
.service-desc { font-size: 15px; line-height: 1.6; color: var(--stone); flex: 1 1 300px; max-width: 420px; }

/* ---------- Work / Rimba ---------- */
.work {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(36px, 5vw, 64px);
  padding: clamp(56px, 8vw, 90px) var(--pad-x);
  align-items: center;
}
.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.phone {
  width: min(300px, 78vw); padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 30px; }
.strava-badge { display: block; margin-top: -6px; opacity: .3; transition: opacity .25s ease; }
.strava-badge:hover, .strava-badge:focus-visible { opacity: .7; }
.strava-badge img { display: block; width: 92px; height: auto; }
.work-copy { display: flex; flex-direction: column; gap: 22px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--ash); }
.work-title { font-size: clamp(44px, 6vw, 68px); font-weight: 500; letter-spacing: -.02em; }
.work-desc { font-size: 17px; line-height: 1.7; color: var(--stone); max-width: 520px; text-wrap: pretty; }
.work-desc em { font-family: var(--serif); font-style: italic; }
.work-link {
  font-family: var(--mono); font-size: 13px; color: var(--bone); text-decoration: none;
  border-bottom: 1px solid var(--bone); padding-bottom: 3px; width: fit-content;
}

/* ---------- Workshop / in-progress pager ---------- */
.workshop {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(36px, 5vw, 64px);
  padding: clamp(56px, 8vw, 90px) var(--pad-x);
  border-top: 1px solid var(--line);
  align-items: center;
}
/* Two columns: copy left, laptop right (DOM has laptop first so it stacks on top on mobile) */
@media (min-width: 720px) {
  .workshop .laptop-wrap { order: 2; }
}
.laptop-wrap { display: flex; justify-content: center; }
/* Stage stacks device slides (laptop or phone) in one cell; sized by the tallest */
.device-stage { display: grid; width: min(540px, 100%); touch-action: pan-y; }
.device-slide { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; }
.device-slide:not(.is-active) { visibility: hidden; }
.device-slide .laptop { width: 100%; }
/* Smaller phone frame for workshop portrait screenshots (mirrors .phone / Rimba) */
.phone-sm { width: auto; padding: 7px; border-radius: 26px; }
.phone-sm img { width: auto; height: clamp(340px, 44vw, 430px); border-radius: 20px; }
.laptop { width: min(540px, 100%); }
.laptop-screen {
  display: grid; /* slides stack in the same cell */
  aspect-ratio: 16 / 10;
  padding: clamp(8px, 1.5vw, 12px);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px 14px 4px 4px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  touch-action: pan-y;
}
.laptop-base {
  height: 12px; margin: 0 -4%;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 3px 3px 10px 10px;
}
.laptop-shot { grid-area: 1 / 1; overflow: hidden; border-radius: 6px; }
.laptop-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }.shot-placeholder {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--ink); border: 1px dashed var(--line-strong); border-radius: 6px;
  text-align: center; padding: 16px;
}
.ph-name { font-size: clamp(18px, 2.5vw, 24px); font-weight: 500; color: var(--stone); }
.ph-status { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--ash); }

.workshop-copy { display: flex; flex-direction: column; gap: 22px; }
.workshop-slides { display: grid; }
.workshop-slide { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 16px; }
.workshop-slide:not(.is-active) { visibility: hidden; }
.workshop-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.workshop-title { font-size: clamp(28px, 4vw, 40px); font-weight: 500; letter-spacing: -.02em; }
.status-chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--stone);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px;
  white-space: nowrap;
}
.workshop-desc { font-size: 16px; line-height: 1.7; color: var(--stone); max-width: 520px; text-wrap: pretty; }
.workshop-nav { display: flex; align-items: center; gap: 18px; }
.ws-arrow {
  font-family: var(--mono); font-size: 14px; color: var(--bone);
  background: none; border: 1px solid var(--line-strong); border-radius: 999px;
  width: 42px; height: 42px; cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}
.ws-arrow:hover { border-color: var(--stone); background-color: #141311; }
.ws-index { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--ash); }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  border-top: 1px solid var(--line);
  padding: clamp(60px, 9vw, 100px) var(--pad-x);
  display: flex; flex-direction: column; gap: clamp(22px, 3vw, 30px);
  overflow: hidden;
}
.contact h2 {
  font-size: clamp(38px, 5.5vw, 60px); font-weight: 500;
  letter-spacing: -.02em; line-height: 1.05;
  position: relative; z-index: 1;
}
.contact-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.btn-mail {
  display: inline-block;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  padding: 15px 30px; background: var(--bone); color: var(--ink);
  border: none; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
}
.btn-mail:hover { opacity: 1; transform: translateY(-2px); }
.guarantee {
  font-size: 15px; line-height: 1.7; color: var(--stone);
  max-width: 520px; text-wrap: pretty; position: relative; z-index: 1;
}
.guarantee em { font-family: var(--serif); font-style: italic; color: var(--bone); }
.guarantee-link {
  font-family: var(--mono); font-size: 12px; color: var(--ash);
  text-decoration: none; border-bottom: 1px solid var(--line);
}
.guarantee-link:hover { color: var(--stone); }

/* ---------- Support / coffee ---------- */
.support {
  border-top: 1px solid var(--line);
  padding: clamp(36px, 5vw, 56px) var(--pad-x);
  display: flex; justify-content: space-between; align-items: center;
  gap: clamp(24px, 4vw, 48px); flex-wrap: wrap;
}
.support-copy { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.support-copy p { font-size: 15px; line-height: 1.7; color: var(--stone); text-wrap: pretty; }
.btn-coffee {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  color: var(--bone); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 13px 24px;
  transition: border-color .25s ease, background-color .25s ease, opacity .25s ease;
}
.btn-coffee:hover { opacity: 1; border-color: var(--stone); background-color: #141311; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--pad-x);
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ash); line-height: 1.6;
}
.footer-story { max-width: 640px; text-wrap: pretty; }
.footer-story em { font-family: var(--serif); font-style: normal; }

/* ---------- Legal pages ---------- */
.legal {
  padding: clamp(40px, 7vw, 80px) var(--pad-x) clamp(64px, 10vw, 110px);
  max-width: 720px;
  margin-inline: auto;
}
.legal h1 {
  font-size: clamp(38px, 6vw, 64px); font-weight: 500;
  letter-spacing: -.02em; line-height: 1.05; margin-bottom: 10px;
}
.legal h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.legal-updated { font-family: var(--mono); font-size: 12px; color: var(--ash); margin-bottom: 36px; }
.legal h2 {
  font-size: 20px; font-weight: 500; margin: 36px 0 10px;
}
.legal p { font-size: 16px; line-height: 1.7; color: var(--stone); text-wrap: pretty; }
.legal p + p { margin-top: 12px; }
.legal a { color: var(--bone); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.footer-link { color: var(--ash); text-decoration: none; border-bottom: 1px solid var(--line); }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .hero-meta { text-align: left; }
  .service-num { flex-basis: 100%; }
  .contact-actions { flex-direction: column; align-items: stretch; }
  .btn-mail { text-align: center; }
}
