/* jfi.gs portfolio: one stylesheet for every page.
   Colors, type and spacing live in the tokens below; change them here, not per page. */

:root {
  color-scheme: dark;
  --paper: #0a1442;       /* deep navy base under the gradient */
  --ink: #e9edf7;
  --ink-soft: #cdd2e2;
  --rule: rgba(169, 180, 207, 0.22);
  --accent: #c9f0ff;      /* pale ice blue: reads against both the navy and the amber glow */
  --accent-wash: rgba(201, 240, 255, 0.08);
  --todo-bg: #4a3d0a;
  --todo-ink: #ffe9a0;

  /* The background: dusk. Deep navy at the top, through plum, into a golden
     amber glow along the bottom edge. The brightest part of the glow sits just
     below the screen so text near the bottom stays readable. */
  --gradient:
    radial-gradient(ellipse 130% 55% at 50% 132%, rgba(255, 176, 72, 0.85), rgba(232, 118, 40, 0.5) 40%, transparent 74%),
    radial-gradient(ellipse 60% 35% at 90% 108%, rgba(255, 128, 48, 0.28), transparent 70%),
    linear-gradient(180deg, #0a1442 0%, #101f5c 32%, #2a2763 55%, #583050 76%, #86412e 100%);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.1875rem;   /* body: 19px reading size */
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4.2vw, 3rem);
  --step-4: clamp(2.125rem, 5.2vw, 3.875rem);

  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --page: 72rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  min-height: 100vh;
}

/* The gradient sits on a fixed layer so it stays put while the page scrolls,
   including on iPhones, which ignore background-attachment: fixed. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: var(--gradient);
  pointer-events: none;
}

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

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

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; font-family: var(--sans); font-size: var(--step--1);
}
.skip:focus { top: 1rem; }

/* Placeholders the owner fills in before launch. Search the HTML for "[Add:". */
.todo {
  background: var(--todo-bg); color: var(--todo-ink);
  font-family: var(--sans); font-size: 0.8em; padding: 0.05em 0.35em; border-radius: 3px;
}

/* ---------- Header and footer ---------- */
.site-header, .site-footer, main {
  max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter);
}
.site-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-block: 1.5rem;
  font-family: var(--sans);
}
.wordmark {
  color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em;
}
.site-header nav { display: flex; gap: 1.5rem; font-size: 1rem; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; padding-block: 0.25rem; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--accent); }

.site-footer {
  margin-top: 6rem; padding-block: 0 3rem;
  font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft);
}
.site-footer p { margin: 0; padding-top: 2rem; border-top: 1px solid var(--rule); }

h1, h2, h3 { font-family: var(--sans); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

/* ---------- Home ---------- */
.hero { padding-block: clamp(3rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.02em;
  max-width: 22ch; margin: 0;
}
.hero-sub {
  max-width: var(--measure); margin: 2rem 0 0;
  color: var(--ink-soft); font-size: var(--step-0);
}

.pillars {
  display: grid; gap: 3rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.pillar { border-top: 2px solid var(--accent); padding-top: 1rem; }
.pillar-icon { display: block; width: 2rem; height: 2rem; color: var(--accent); margin: 0.5rem 0 0.75rem; }
.pillar h2 { font-size: var(--step-1); margin: 0 0 0.5rem; }
.pillar > p { margin: 0 0 1.5rem; color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.5; }

.access-note {
  margin-top: 4rem; max-width: var(--measure);
  font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft);
}

/* Project entries: a typographic list, not cards */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { padding-block: 1rem; border-top: 1px solid var(--rule); }
.entry a { text-decoration: none; }
.entry-title { font-family: var(--sans); font-weight: 600; font-size: 1.125rem; }
.entry a:hover .entry-title { text-decoration: underline; text-underline-offset: 0.18em; }
.entry-teaser { margin: 0.35rem 0 0.5rem; font-size: 1.0625rem; line-height: 1.5; }
.entry-meta {
  display: flex; align-items: center; gap: 0.4rem; margin: 0;
  font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft);
}
.lock { width: 0.8rem; height: 0.8rem; flex: none; }

.entries-wide { max-width: 46rem; }
.entries-wide .entry { padding-block: 1.5rem; }
.entries-wide .entry-title { font-size: var(--step-1); }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(2.5rem, 7vw, 5rem) 2rem; max-width: 46rem; }
.page-head h1 { font-size: var(--step-3); margin: 0 0 1rem; }
.page-head p { margin: 0; color: var(--ink-soft); }

.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-1); margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: 1.0625rem; margin: 1.75rem 0 0.25rem; }
.prose h3 + p { margin-top: 0; }
.prose .lead { font-size: var(--step-1); line-height: 1.45; margin-top: 0; }

/* ---------- Case study: book page with a margin column ---------- */
.study {
  display: grid; gap: 0 3.5rem;
  grid-template-columns: minmax(0, var(--measure)) minmax(12rem, 16rem);
  grid-template-areas: "head head" "body glance" "nav nav";
  justify-content: start;
}
.study-head { grid-area: head; padding-block: clamp(2rem, 6vw, 4rem) 2.5rem; max-width: 52rem; }
.crumb { margin: 0 0 1rem; font-family: var(--sans); font-size: var(--step--1); }
.study-head h1 { font-size: var(--step-3); margin: 0 0 1.25rem; }
.headline {
  margin: 0; font-size: var(--step-2); line-height: 1.3; letter-spacing: -0.01em;
  max-width: 30ch;
}

.glance {
  grid-area: glance; align-self: start;
  position: sticky; top: 1.5rem;
  border-top: 2px solid var(--accent); padding-top: 0.75rem;
  font-family: var(--sans); font-size: var(--step--1); line-height: 1.45;
}
.glance h2 { font-size: var(--step--1); margin: 0 0 0.75rem; color: var(--ink); }
.glance dl { margin: 0; }
.glance dt { color: var(--ink-soft); margin-top: 0.75rem; }
.glance dt:first-child { margin-top: 0; }
.glance dd { margin: 0.1rem 0 0; }

.study-body { grid-area: body; }
.study-body section h2 { font-size: var(--step-1); margin: 2.5rem 0 0.75rem; }
.study-body section:first-child h2 { margin-top: 0; }

/* Figures run past the text into the margin, like a plate in a book */
.study-body figure { margin: 2.5rem 0; }
.study-body figure.wide { width: calc(100% + 3.5rem + 16rem); max-width: calc(100vw - 2 * var(--gutter)); }
.ph {
  aspect-ratio: 16 / 9; background: var(--accent-wash);
  border: 1px solid var(--rule); border-radius: 4px;
  display: grid; place-items: center;
  font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft);
}
figcaption {
  margin-top: 0.6rem; max-width: var(--measure);
  font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); line-height: 1.45;
}

.study-nav {
  grid-area: nav; margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 2rem;
  font-family: var(--sans);
}
.study-nav a { text-decoration: none; font-weight: 600; }
.study-nav a[rel="next"] { text-align: right; }
.study-nav span { display: block; font-weight: 400; font-size: var(--step--1); color: var(--ink-soft); }

/* Phones and narrow tablets: one column, glance facts move under the headline */
@media (max-width: 56rem) {
  .study { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "glance" "body" "nav"; }
  .glance { position: static; margin-bottom: 2.5rem; }
  .glance dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; }
  .glance dt, .glance dt:first-child { margin: 0; }
  .glance dd { margin: 0; }
  .study-body figure.wide { width: 100%; }
}
@media (max-width: 30rem) {
  :root { --step-0: 1.125rem; }
  .glance dl { grid-template-columns: 1fr; gap: 0; }
  .glance dd { margin-bottom: 0.6rem; }
}

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

@media print {
  .site-header nav, .skip, .study-nav { display: none; }
  .glance { position: static; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
}
