/* Yerko Marcić — personal site. No JavaScript, no third parties. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-var-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #1B1A17;
  --soft: #57544B;
  --line: #C9C5BA;
  --paper: #F7F6F2;
  --white: #FFFFFF;
  --navy: #1F3A5F;
  --navy-tint: #E9EEF4;
  --head: "Schibsted Grotesk", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 72rem;
  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --r: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* WCAG 2.4.11: the sticky header never covers a focused target */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }
.band :focus-visible { outline-color: var(--white); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

.skip { position: absolute; left: -999rem; top: 0; background: var(--ink); color: var(--white); padding: 0.75rem 1rem; z-index: 20; }
.skip:focus { left: 0; }

/* demo notice — removed before going live */
.demo { background: var(--ink); color: var(--white); font-size: 0.8125rem; text-align: center; padding: 0.45rem var(--gut); margin: 0; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; font-family: var(--head); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; padding: 0.4rem 0; }
.brand img { width: 1.75rem; height: 1.75rem; display: block; }
.nav { display: flex; align-items: center; gap: clamp(0.75rem, 2.2vw, 1.75rem); }
.nav a { font-size: 0.9375rem; color: var(--ink); text-decoration: none; padding: 0.5rem 0; }
.nav a:hover { color: var(--navy); text-decoration: underline; }
.nav .btn, .nav .btn:hover { color: var(--white); text-decoration: none; padding: 0.6rem 1rem; }

.btn {
  display: inline-block; font-weight: 600; font-size: 0.9375rem; line-height: 1.2; white-space: nowrap;
  padding: 0.75rem 1.2rem; border-radius: 6px; text-decoration: none;
  background: var(--navy); color: var(--white); border: 1px solid var(--navy);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--navy-tint); color: var(--navy); border-color: var(--navy); }
.btn.light { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn.light:hover { background: var(--navy-tint); border-color: var(--navy-tint); }
.btn.outline { background: transparent; color: var(--white); border-color: var(--navy-tint); }
.btn.outline:hover { background: var(--white); color: var(--navy); border-color: var(--white); }

/* ---------- shared ---------- */
.label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy); margin: 0; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(1.75rem, 3.8vw, 2.6rem); font-weight: 700; margin-top: 0.7rem; max-width: 22ch; letter-spacing: -0.03em; }
section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--soft); max-width: 56ch; margin: 1.1rem 0 0; }
p { margin: 0 0 1rem; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: end; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.035em; margin-top: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--navy); }
.hero .intro { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--soft); max-width: 54ch; margin: 1.6rem 0 0; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.glance { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.glance-body { padding: 1.5rem 1.5rem 0.6rem; }
.glance .label { display: flex; align-items: center; gap: 0.55rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ink); }
.glance .label::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--navy); }
.glance dl { margin: 0; }
.glance dl div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.45; }
.glance dl div:last-child { border-bottom: 0; }
.glance dt { color: var(--soft); }
.glance dd { margin: 0; font-weight: 600; }

.figures { list-style: none; margin: clamp(2.5rem, 6vw, 4.5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.figures li { padding: 1.5rem 1.5rem 1.6rem; border-left: 1px solid var(--line); }
.figures li:first-child { border-left: 0; }
.figures b { display: block; font-family: var(--head); font-size: clamp(2.2rem, 4.2vw, 3.1rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--navy); }
.figures span { display: block; font-size: 0.9375rem; color: var(--soft); margin-top: 0.7rem; line-height: 1.45; }

/* ---------- work ---------- */
.head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem 3rem; }
.jump { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.jump a { display: inline-block; font-size: 0.875rem; font-weight: 600; text-decoration: none; color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.9rem; }
.jump a:hover { border-color: var(--navy); background: var(--navy-tint); }
.jump b { font-family: var(--head); margin-right: 0.35rem; }

.cases { margin-top: clamp(2rem, 5vw, 3.25rem); display: grid; gap: 1.25rem; }
.case { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.case-id { padding: clamp(1.5rem, 3.2vw, 2.5rem); border-right: 1px solid var(--line); }
.case .num { font-family: var(--head); font-weight: 700; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 0.9; letter-spacing: -0.05em; color: var(--navy-tint); margin: 0; }
.case h3 { font-size: clamp(1.3rem, 2.3vw, 1.65rem); font-weight: 700; margin-top: 1rem; }
.case .org { color: var(--soft); font-size: 0.9375rem; line-height: 1.45; margin: 0.75rem 0 0; }
.tags { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.8125rem; font-weight: 600; color: var(--navy); background: var(--navy-tint); border-radius: 4px; padding: 0.2rem 0.55rem; }
.steps { margin: 0; display: flex; flex-direction: column; }
.steps div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding: 1.25rem clamp(1.5rem, 3.2vw, 2.5rem); border-top: 1px solid var(--line); }
.steps div:first-child { border-top: 0; padding-top: clamp(1.5rem, 3.2vw, 2.5rem); }
.steps dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); padding-top: 0.3rem; }
.steps dd { margin: 0; }
.steps .out { background: var(--navy-tint); border-top-color: var(--navy-tint); flex: 1; align-content: start; }
.steps .out dt { color: var(--navy); }
.steps .out dd { font-weight: 600; color: var(--navy); font-size: 1.125rem; line-height: 1.45; }
.also { margin: 1.75rem 0 0; color: var(--soft); max-width: 70ch; }

/* ---------- approach (navy band) ---------- */
.band { background: var(--navy); color: var(--white); }
.band .label { color: var(--navy-tint); }
.band .lead { color: var(--navy-tint); }
.split { margin-top: clamp(2.25rem, 5vw, 3.5rem); }
.one { display: flex; justify-content: center; }
.one p { margin: 0; text-align: center; background: var(--white); color: var(--navy); border-radius: var(--r); padding: 0.9rem 1.4rem; font-weight: 600; max-width: 34rem; line-height: 1.45; }
.one span { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); margin-bottom: 0.2rem; }
.fork { position: relative; height: 1.5rem; margin: 1.5rem 25% 0; border: 1px solid var(--navy-tint); border-bottom: 0; }
.fork::before { content: ""; position: absolute; left: 50%; top: -1.5rem; height: 1.5rem; border-left: 1px solid var(--navy-tint); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.version { background: var(--white); color: var(--ink); border-radius: var(--r); padding: clamp(1.4rem, 3vw, 2.1rem); }
.version .label { color: var(--navy); margin-bottom: 0.9rem; }
.version p:last-child { margin-bottom: 0; font-size: 1.125rem; line-height: 1.5; }
.after { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 4.5rem); margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2rem, 4vw, 2.75rem); border-top: 1px solid var(--navy-tint); }
.after .label { padding-top: 0.5rem; }
.after p:last-child { font-family: var(--head); font-size: clamp(1.25rem, 2.3vw, 1.7rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; margin: 0; }

/* ---------- background ---------- */
.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 5rem); margin-top: clamp(2rem, 5vw, 3.25rem); align-items: start; }
.story .big { font-family: var(--head); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; }
.story .text p { max-width: 46ch; }

.line { list-style: none; margin: 0; padding: 0; position: relative; }
.line li { position: relative; padding: 0 0 1.6rem 2.25rem; }
.line li::before { content: ""; position: absolute; left: 0; top: 0.4rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--navy); }
.line li:not(.next)::after { content: ""; position: absolute; left: 0.4375rem; top: 1.6rem; bottom: -0.2rem; border-left: 2px solid var(--line); }
.line li.key::before { background: var(--navy); }
.line time { display: block; font-size: 0.875rem; color: var(--soft); font-variant-numeric: tabular-nums; }
.line b { display: block; font-weight: 700; }
.line span { display: block; color: var(--soft); font-size: 0.9375rem; line-height: 1.45; }
.line .quote { color: var(--navy); font-weight: 600; margin-top: 0.3rem; }
.line li.next { padding-bottom: 0; }
.line li.next::before { border-style: dashed; }
.next-card { background: var(--white); border: 1px dashed var(--navy); border-radius: var(--r); padding: 1.1rem 1.25rem; margin-top: 0.5rem; }
.next-card p { margin: 0; font-size: 0.9375rem; line-height: 1.5; }
.next-card p + p { margin-top: 0.6rem; color: var(--soft); }

/* ---------- credentials ---------- */
.white { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts { margin: clamp(2rem, 5vw, 3.25rem) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.facts div { border-top: 2px solid var(--ink); padding-top: 1rem; }
.facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy); margin-bottom: 0.7rem; }
.facts dd { margin: 0; line-height: 1.5; font-size: 0.9875rem; }
.facts dd + dd { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.facts small { display: block; color: var(--soft); font-size: 0.8125rem; }

/* ---------- contact ---------- */
.contact .card { border-radius: var(--r); padding: clamp(2rem, 6vw, 4.5rem); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: end; }
.contact h2 { max-width: 18ch; }
.ways { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.ways .btn { display: block; text-align: center; }
.ways .copy { margin-top: 0.15rem; font-size: 0.875rem; text-align: center; color: var(--navy-tint); overflow-wrap: anywhere; }
.ways .copy span { color: var(--white); font-weight: 600; -webkit-user-select: all; user-select: all; }

footer { padding: 0 0 3rem; font-size: 0.875rem; color: var(--soft); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
footer p { margin: 0; }
footer a { color: var(--soft); }

/* ---------- photos: portrait in the hero card, full length next to the story ---------- */
.glance .portrait { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.story .photo { margin: 1.75rem 0 0; max-width: 20rem; }
.story .photo img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); }

/* ---------- motion: only where supported, never when reduced ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .case, .version {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
    @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  }
}

/* ---------- small screens ---------- */
@media (max-width: 60rem) {
  .hero-grid, .story, .after, .contact .card { grid-template-columns: 1fr; align-items: start; }
  .facts { grid-template-columns: 1fr 1fr; }
  /* one column: photo and facts side by side while there is room */
  .glance { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .glance .portrait { height: 100%; object-fit: cover; object-position: 60% 20%; border-bottom: 0; border-right: 1px solid var(--line); }
}
@media (max-width: 44rem) {
  .glance { display: block; }
  .glance .portrait { height: auto; aspect-ratio: 16 / 9; object-position: 50% 18%; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 52rem) {
  .nav a:not(.btn) { display: none; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures li:nth-child(3) { border-left: 0; }
  .figures li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .case { grid-template-columns: 1fr; }
  .case-id { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps div { grid-template-columns: 1fr; gap: 0.25rem; }
  .steps dt { padding-top: 0; }
  .two { grid-template-columns: 1fr; }
  .fork { display: none; }
  .one { margin-bottom: 1.25rem; }
}
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; }
  .glance .portrait { aspect-ratio: auto; }
}

@media print {
  .top, .demo, .jump, .actions { display: none; }
  .band { background: var(--white); color: var(--ink); }
  .ways .copy, .ways .copy span { color: var(--ink); }
  section { padding: 1.5rem 0; }
}
