/* Rune Kristensen, personal site
   One stylesheet, tokens first. */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-normal-400.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-normal-400_600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-normal-400_500.woff2") format("woff2");
}

:root {
  color-scheme: dark light;

  --bg: #0b0c0e;
  --bg-soft: #101216;
  --surface: #121417;
  --surface-raised: #171a1f;
  --text: #ecebe7;
  --text-dim: #b9babf;
  --muted: #8b8e96;
  --line: rgba(236, 235, 231, 0.12);
  --line-strong: rgba(236, 235, 231, 0.22);
  --accent: #f7931a;
  --accent-ink: #0b0c0e;

  --serif: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1080px;
  --pad: clamp(20px, 5vw, 40px);
  --radius: 2px;

  --step: clamp(56px, 8vw, 96px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ee;
    --bg-soft: #efece5;
    --surface: #fbfaf7;
    --surface-raised: #ffffff;
    --text: #17191c;
    --text-dim: #3d4046;
    --muted: #666a72;
    --line: rgba(23, 25, 28, 0.14);
    --line-strong: rgba(23, 25, 28, 0.28);
    --accent: #9a4108;
    --accent-ink: #fffaf2;
  }
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 82% -8%, rgba(247, 147, 26, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: light) {
  body {
    background:
      radial-gradient(900px 420px at 82% -8%, rgba(180, 83, 9, 0.08), transparent 60%),
      var(--bg);
  }
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

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

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}

ul { margin: 0; padding: 0; list-style: none; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  z-index: 100;
  font: 600 14px/1 var(--sans);
}
.skip:focus { left: 12px; top: 12px; }

/* Header */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.monogram {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-right: auto;
  padding-block: 14px;
}
.monogram .dot { color: var(--accent); }

.site-head nav {
  display: flex;
  gap: 26px;
}

.site-head nav a,
.head-mail {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-block: 14px;
  transition: color 160ms ease;
}

.site-head nav a:hover,
.head-mail:hover { color: var(--text); }

.head-mail { color: var(--text-dim); text-transform: none; letter-spacing: 0.04em; font-size: 12px; }

@media (max-width: 720px) {
  .site-head nav { display: flex; gap: 14px; }
  .site-head nav a { font-size: 10px; letter-spacing: 0.06em; padding-block: 20px; }
  .head-mail { display: none; }
}

/* Hero */

.hero {
  padding-top: clamp(56px, 11vh, 120px);
  padding-bottom: var(--step);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(247, 147, 26, 0.5);
  animation: pulse 4s ease-out infinite;
  flex: none;
}

@keyframes pulse {
  0%, 70% { box-shadow: 0 0 0 0 rgba(247, 147, 26, 0.45); }
  100% { box-shadow: 0 0 0 9px rgba(247, 147, 26, 0); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.hero-copy { padding-top: 14px; padding-bottom: 8px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { padding-top: 0; padding-bottom: 0; }
}

h1 {
  font-size: clamp(58px, 12.8vw, 142px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin-left: -0.05em;
}

.lede {
  max-width: 36ch;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.5;
  color: var(--text);
}

.lede-sub {
  max-width: 56ch;
  color: var(--text-dim);
  margin-top: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: clamp(44px, 7vw, 72px) 0 0;
  border-top: 1px solid var(--line);
}

.stats div {
  display: flex;
  flex-direction: column;
  padding: 22px 18px 0 0;
  border-right: 1px solid var(--line);
}
.stats div:last-child { border-right: 0; }

.stats dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  min-height: 2.4em;
}

.stats dd {
  margin: auto 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stats .arrow {
  color: var(--accent);
  font-size: 0.7em;
  vertical-align: 0.1em;
  padding: 0 0.08em;
}

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div {
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 16px 16px 16px 0;
    margin-bottom: 0;
  }
  .stats div:nth-child(odd) { border-right: 0; padding-right: 16px; }
}

/* Sections */

.section {
  padding-block: var(--step);
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.section-head { margin-bottom: clamp(36px, 5vw, 56px); }

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.section-note {
  margin-top: 14px;
  color: var(--muted);
  max-width: 54ch;
}

/* Work entries */

.entry {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--line);
}

.entry:first-of-type { border-top: 0; padding-top: 0; }

.entry-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.entry h3 {
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}

.entry-role {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

.entry-body p { max-width: 66ch; color: var(--text-dim); }
.entry-body p + .points { margin-top: 22px; }

.points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  max-width: 64ch;
  color: var(--text);
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.stack {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted) !important;
}

@media (max-width: 760px) {
  .entry { grid-template-columns: 1fr; gap: 18px; }
}

/* Project cards */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface);
  text-decoration: none;
  transition: background 180ms ease;
}

.card:hover { background: var(--surface-raised); }
.card:hover .card-link { color: var(--accent); }
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 5px; }

.card-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.card h3 {
  font-size: clamp(23px, 2.4vw, 28px);
  letter-spacing: -0.015em;
}

.card p:not(.card-tag):not(.card-link) {
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0;
}

.card-link {
  margin: auto 0 0;
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text);
  transition: color 160ms ease;
}

.card-link span { padding-left: 8px; }

.go {
  width: 11px;
  height: 11px;
  margin-left: 8px;
  vertical-align: 0.05em;
  color: currentColor;
}

.card-link .go { transition: transform 160ms ease; }
.card:hover .card-link .go { transform: translate(2px, -2px); }

@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
}

/* Also */

.also {
  margin-top: clamp(40px, 6vw, 64px);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  border-top: 1px solid var(--line);
  padding-top: clamp(28px, 4vw, 40px);
}

.also h3 {
  font-size: 20px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.also li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 12px;
  color: var(--text-dim);
  max-width: 76ch;
}

.also li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.also strong { color: var(--text); font-weight: 600; }

@media (max-width: 760px) {
  .also { grid-template-columns: 1fr; gap: 16px; }
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  column-gap: clamp(32px, 6vw, 80px);
  row-gap: 32px;
  align-items: start;
}

.about-text { grid-column: 1; grid-row: 1 / span 2; }

.portrait {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 320px;
  margin: 0;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.facts { grid-column: 2; grid-row: 2; }

@media (max-width: 820px) {
  .about-text,
  .portrait,
  .facts { grid-column: 1; grid-row: auto; }
  .portrait { width: 68%; margin-bottom: 26px; }
}

.about-text p {
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 18px;
}

.about-text p:first-child { color: var(--text); }

.facts { border-top: 1px solid var(--line); }

.fact {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.fact-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}

.fact p:last-child { margin: 0; font-size: 15px; color: var(--text-dim); }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Contact */

.contact h2 { max-width: 18ch; }

.contact-lede {
  margin-top: 18px;
  max-width: 52ch;
  color: var(--text-dim);
}

.contact-links {
  margin-top: clamp(32px, 5vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.big-mail {
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  transition: border-color 160ms ease, color 160ms ease;
}

.big-mail span { padding-left: 12px; color: var(--accent); font-size: 0.7em; }
.big-mail:hover { border-color: var(--accent); }

.socials { display: flex; gap: 24px; }

.socials a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-block: 12px;
  transition: color 160ms ease;
}
.socials a:hover { color: var(--text); }

@media (max-width: 560px) {
  .socials { gap: 18px; }
}

/* Footer */

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 26px;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.foot-inner p { margin: 0; }

/* Print */

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --text-dim: #222222;
    --muted: #444444;
    --line: #cccccc;
  }
  body { background: #ffffff; font-size: 11pt; }
  .site-head, .contact-links .socials, .skip { display: none; }
  .hero { padding-top: 0; }
  h1 { font-size: 40pt; }
  .section, .entry, .card { break-inside: avoid; }
  a { text-decoration: none; }
}
