@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('fonts/schibsted-grotesk.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FAFAF8;
  --ink: #1A1C20;
  --muted: #6B6E76;
  --rule: #E2E2DE;
  --mango: #F2A20C;
  --max: 1120px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--mango); color: var(--ink); }

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* Header */
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.site-name {
  font-weight: 600;
  text-decoration: none;
  font-size: 1.0625rem;
}

.site-nav { display: flex; gap: 2rem; }

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color .2s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--mango);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

main { flex: 1; }

/* Inline links */
.link {
  text-decoration: underline;
  text-decoration-color: var(--mango);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness .15s;
}

.link:hover { text-decoration-thickness: 5px; }

/* Home hero */
.hero { padding-top: clamp(4rem, 12vh, 9rem); padding-bottom: clamp(4rem, 10vh, 7rem); }

.hero-name {
  font-size: clamp(4.5rem, 22vw, 12.5rem);
  font-weight: 650;
  line-height: .88;
  letter-spacing: -0.045em;
  margin-left: -0.05em;
}

.hero-name .line { display: block; }

.hero-name .ch { display: inline-block; }

.hero-text {
  margin-top: 2.5rem;
  max-width: 34rem;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  font-weight: 400;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-name .ch {
    opacity: 0;
    transform: translateY(0.35em);
    animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards;
    animation-delay: calc(var(--i) * 45ms);
  }
  .hero-text {
    opacity: 0;
    animation: fade .8s ease forwards;
    animation-delay: .75s;
  }
}

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* Page titles */
.page-head { padding-top: clamp(3rem, 9vh, 6rem); padding-bottom: clamp(2.5rem, 6vh, 4rem); }

.page-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 650;
  line-height: .95;
  letter-spacing: -0.035em;
}

.page-intro {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted);
}

/* Section heading */
.section { padding-bottom: clamp(3.5rem, 9vh, 6rem); }

.section-head {
  font-size: 1.0625rem;
  font-weight: 600;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
}

/* Work list (index rows) */
.rows { list-style: none; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 7rem;
  gap: 2rem;
  align-items: baseline;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

a.row:hover .row-title {
  text-decoration: underline;
  text-decoration-color: var(--mango);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
}

.row-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.row-desc { color: var(--muted); max-width: 36rem; }

.row-meta { color: var(--muted); white-space: nowrap; font-size: .9375rem; text-align: right; }

/* Work entries */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: 2rem 4rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 2rem;
}

.entry:first-of-type { border-top: 1px solid var(--ink); }

.entry h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
}

.entry .role { margin-top: .75rem; color: var(--muted); }

.entry-body p { max-width: 38rem; }

.entry-body p + p { margin-top: 1rem; }

.stack {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: .9375rem;
}

.entry-link { display: inline-block; margin-top: 1.25rem; }

.entry-img {
  margin-top: 1.75rem;
  max-width: 38rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.entry-img img { display: block; width: 100%; height: auto; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 4rem;
  align-items: start;
  padding-bottom: clamp(3.5rem, 9vh, 6rem);
}

.portrait {
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bio p {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.45;
  font-weight: 400;
  max-width: 36rem;
}

.bio p + p { margin-top: 1.25rem; }

.facts { list-style: none; }

.fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 7rem;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.fact strong { font-weight: 600; font-size: 1.1875rem; }

.fact span { color: var(--muted); }

.fact .when { white-space: nowrap; font-size: .9375rem; text-align: right; }

.skills {
  padding-top: 1.25rem;
  max-width: 44rem;
  font-size: 1.1875rem;
  line-height: 1.7;
}

/* Contact */
.contact-email {
  display: inline-block;
  font-size: clamp(1.75rem, 5.5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  word-break: break-all;
}

.contact-list { list-style: none; margin-top: 4rem; max-width: 40rem; }

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

.contact-list li:first-child { border-top: 1px solid var(--ink); }

.contact-list span { color: var(--muted); }

/* Footer */
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: .9375rem;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer nav { display: flex; gap: 1.5rem; }

@media (max-width: 760px) {
  .site-nav { gap: 1.25rem; }
  .row, .fact { grid-template-columns: 1fr; gap: .4rem; }
  .row-meta, .fact .when { text-align: left; }
  .entry, .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait { max-width: 22rem; }
  .site-footer .wrap { flex-direction: column; }
}
