/* Kristofer Skrade portfolio. Drafting-paper palette, ink type, one highlighter accent. */
:root {
  --paper: #eef1f3;
  --sheet: #ffffff;
  --ink: #18212b;
  --graphite: #55606c;
  --rule: #cbd2d8;
  --marker: #f5c518;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, serif;
  --measure: 68ch;
  --wide: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--marker); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; text-decoration: none; }
.nav { display: flex; gap: 6px; align-items: center; font-family: var(--display); font-size: 0.98rem; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 6px; }
.nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--marker); border-radius: 0; }
.nav a:hover { background: var(--sheet); }
.nav .cv-btn { background: var(--ink); color: var(--paper); margin-left: 8px; }
.nav .cv-btn:hover { background: var(--ink); color: var(--marker); }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: end; }
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(3.2rem, 8.5vw, 7.4rem); line-height: 0.9; letter-spacing: -0.045em;
  margin: 0 0 28px;
}
.hero .role { font-family: var(--display); font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 500; margin: 0 0 18px; letter-spacing: -0.01em; }
.hero .lede { max-width: 34ch; font-size: 1.25rem; line-height: 1.55; color: var(--graphite); margin: 0 0 32px; }
.hero .portrait { position: relative; }
.hero .portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 4px; filter: grayscale(0.15); }
.hero .portrait figcaption { font-size: 0.9rem; color: var(--graphite); margin-top: 10px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 6px; text-decoration: none;
  border: 1.5px solid var(--ink);
}
.btn-solid { background: var(--marker); border-color: var(--marker); color: var(--ink); }
.btn-solid:hover { background: var(--ink); border-color: var(--ink); color: var(--marker); text-decoration: none; }
.btn-line:hover { background: var(--sheet); text-decoration: none; }

/* Logo strip */
.brands { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 30px 0; }
.brands .wrap { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.brands h2 { font-family: var(--display); font-size: 1rem; font-weight: 600; margin: 0; color: var(--graphite); }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 34px; list-style: none; margin: 0; padding: 0; }
.logo-row li { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 0.95rem; font-weight: 600; }
.logo-row img { height: 40px; width: 40px; object-fit: contain; border-radius: 6px; background: #fff; }
.logo-row .type-mark { font-family: var(--text); font-weight: 700; font-size: 1.05rem; border: 1.5px solid var(--ink); padding: 4px 8px; border-radius: 4px; }

/* Sections */
.section { padding: 96px 0 24px; }
.section-head { max-width: var(--measure); margin-bottom: 48px; }
.section-head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; line-height: 1; margin: 0 0 18px; }
.section-head p { margin: 0; color: var(--graphite); font-size: 1.2rem; }

.theme { margin: 0 0 32px; padding-top: 32px; border-top: 2px solid var(--ink); display: flex; justify-content: space-between; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.theme h3 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; margin: 0; }
.theme span { color: var(--graphite); font-size: 1rem; }

/* Project sheet */
.project { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; margin: 0 0 40px; overflow: hidden; }
.project .shots { display: grid; gap: 2px; background: var(--rule); }
.project .shots.two { grid-template-columns: 1.6fr 1fr; }
.project .shots.three { grid-template-columns: repeat(3, 1fr); }
.shot { margin: 0; background: var(--sheet); }
.shot button { all: unset; cursor: zoom-in; display: block; width: 100%; position: relative; }
.shot button:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.shot img { width: 100%; height: auto; max-height: 640px; object-fit: contain; background: #f6f7f8; }
.shot .zoom { position: absolute; right: 12px; bottom: 12px; font-family: var(--display); font-size: 0.82rem; background: var(--ink); color: var(--paper); padding: 5px 10px; border-radius: 4px; opacity: 0; transition: opacity 0.15s; }
.shot button:hover .zoom, .shot button:focus-visible .zoom { opacity: 1; }

.project .body { padding: 32px 36px 36px; }
.project h4 { font-family: var(--display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 6px; }
.project .where { color: var(--graphite); font-size: 1rem; margin: 0 0 22px; }
.ps { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.ps h5 { font-family: var(--display); font-size: 1rem; font-weight: 700; margin: 0 0 6px; }
.ps p { margin: 0; }

/* Doodle interlude: the hand behind the systems */
.doodle { padding: 88px 0; }
.doodle figure { margin: 0; display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; }
.doodle img { mix-blend-mode: multiply; border-radius: 2px; }
.doodle figcaption { font-family: var(--text); font-style: italic; font-size: 1.35rem; line-height: 1.5; color: var(--graphite); max-width: 26ch; }
.doodle figcaption b { display: block; font-style: normal; font-family: var(--display); font-size: 1rem; color: var(--ink); margin-bottom: 10px; }

/* About */
.about .grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; }
.about .grid p { margin: 0 0 18px; max-width: var(--measure); }
.facts { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.facts li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; font-size: 1rem; }
.facts li b { font-family: var(--display); font-weight: 600; }

/* Leadership page */
.lead-hero { padding: 96px 0 40px; }
.lead-hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.8rem, 7vw, 5.8rem); letter-spacing: -0.045em; line-height: 0.95; margin: 0 0 24px; max-width: 14ch; }
.lead-hero p { max-width: var(--measure); font-size: 1.25rem; color: var(--graphite); margin: 0 0 16px; }

.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); overflow: hidden; }
.process li { padding: 26px 24px 28px; border-right: 1px solid var(--rule); counter-increment: step; }
.process li:last-child { border-right: 0; }
.process li::before { content: counter(step); font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; display: block; margin-bottom: 14px; color: var(--ink); }
.process h3 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 6px; }
.process p { margin: 0; font-size: 1rem; color: var(--graphite); }

.record { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; list-style: none; padding: 0; margin: 0; }
.record li { padding: 20px 0; border-top: 1px solid var(--rule); font-size: 1.08rem; }
.record li strong { font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: -0.02em; display: block; line-height: 1.15; margin-bottom: 4px; }
.record li span { color: var(--graphite); font-size: 0.95rem; display: block; margin-top: 4px; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--ink); }
.timeline li { padding: 0 0 30px 28px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.timeline li:first-child::before { background: var(--marker); }
.timeline h3 { font-family: var(--display); font-size: 1.25rem; margin: 0; }
.timeline .meta { color: var(--graphite); font-size: 1rem; margin: 2px 0 8px; }
.timeline p { margin: 0; max-width: var(--measure); }

/* Footer / contact */
.contact { margin-top: 96px; background: var(--ink); color: var(--paper); padding: 88px 0 56px; }
.contact .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; }
.contact h2 { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.8rem); letter-spacing: -0.04em; line-height: 0.95; margin: 0; }
.contact ul { list-style: none; margin: 0; padding: 0; font-size: 1.15rem; }
.contact li { padding: 10px 0; border-bottom: 1px solid #3a4652; }
.contact a:hover { text-decoration-color: var(--marker); }
.contact .small { grid-column: 1 / -1; font-size: 0.9rem; color: #9aa6b2; margin-top: 40px; }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog.lightbox::backdrop { background: rgba(24, 33, 43, 0.92); }
dialog.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; background: #fff; border-radius: 4px; }
dialog.lightbox p { color: #e8ecef; font-family: var(--display); margin: 10px 0 0; font-size: 0.95rem; }
dialog.lightbox .close { position: fixed; top: 18px; right: 22px; font-family: var(--display); font-size: 1rem; background: var(--marker); color: var(--ink); border: 0; padding: 9px 14px; border-radius: 6px; cursor: pointer; }

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap, .about .grid, .doodle figure, .contact .wrap { grid-template-columns: 1fr; }
  .hero .portrait { max-width: 420px; }
  .brands .wrap { grid-template-columns: 1fr; gap: 16px; }
  .project .shots.two, .project .shots.three { grid-template-columns: 1fr; }
  .ps { grid-template-columns: 1fr; gap: 20px; }
  .process { grid-template-columns: 1fr 1fr; }
  .process li:nth-child(2) { border-right: 0; }
  .process li:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .record { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 1.05rem; }
  .wrap { padding: 0 18px; }
  .site-header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 9px; }
  .project .body { padding: 24px 20px 26px; }
  .process { grid-template-columns: 1fr; }
  .process li { border-right: 0; border-bottom: 1px solid var(--rule); }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
}

/* Compact project grid + detail dialog */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; height: 100%; width: 100%; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.card-btn:hover { border-color: var(--ink); }
.card-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.card-btn img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #f6f7f8; border-bottom: 1px solid var(--rule); }
.card-text { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.tag { font-family: var(--display); font-size: 0.8rem; font-weight: 600; align-self: flex-start; background: var(--paper); padding: 2px 8px; border-radius: 4px; }
.card-title { font-family: var(--display); font-weight: 700; font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.01em; }
.card-where { color: var(--graphite); font-size: 0.92rem; line-height: 1.4; }
.card-btn:hover .card-title { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 3px; text-underline-offset: 4px; }

dialog.case { border: 0; border-radius: 8px; padding: 0; width: min(1100px, 94vw); max-height: 92vh; overflow-y: auto; background: var(--sheet); color: var(--ink); }
dialog.case::backdrop { background: rgba(24, 33, 43, 0.85); }
dialog.case .close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 2; font-family: var(--display); font-size: 1rem; background: var(--marker); color: var(--ink); border: 0; padding: 9px 14px; border-radius: 6px; cursor: pointer; }
.case-body { padding: 36px 40px 40px; }
.case-body h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 6px; max-width: 26ch; }
.case-body .where { color: var(--graphite); margin: 0 0 24px; }
.case-body .ps { margin-bottom: 28px; }
.case-body .shots { display: grid; gap: 12px; }
.case-body .shot img { max-height: 70vh; object-fit: contain; border: 1px solid var(--rule); border-radius: 4px; }

@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } .case-body { padding: 24px 20px 28px; } }

.with-logo { display: flex; align-items: center; gap: 12px; }
.with-logo img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.timeline li { padding-left: 32px; }
.tl-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.tl-head img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--rule); flex: none; }
.tl-head .type-mark { font-family: var(--text); font-weight: 700; font-size: 0.95rem; border: 1.5px solid var(--ink); padding: 9px 4px; border-radius: 8px; width: 44px; text-align: center; flex: none; background: #fff; }
.tl-head .meta { margin: 2px 0 0; }
.timeline .team { margin: 0 0 6px; }
.timeline .team b { font-family: var(--display); }
