@font-face {
  font-family: Schibsted;
  src: url('/brand/fonts/SchibstedGrotesk-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Schibsted;
  src: url('/brand/fonts/SchibstedGrotesk-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

/* Shared palette, typography and interaction timing. */
:root {
  --hn-paper: #f1f1ef;
  --hn-ink: #1c1c1c;
  --hn-fresh: #a8c84b;
  --hn-forest: #36552d;
  --hn-bg: var(--hn-paper);
  --hn-fg: var(--hn-ink);
  --hn-muted: #555d52;
  --hn-surface: #e5e8de;
  --hn-action-bg: var(--hn-forest);
  --hn-action-fg: var(--hn-paper);
  --hn-line: #cbd0c5;
  --hn-focus: #36552d;
  --hn-ease: cubic-bezier(.2, .7, .2, 1);
  --hn-time-feedback: 180ms;
  --hn-time-press: 100ms;
  --hn-wrap: 1280px;
  --hn-gutter: clamp(24px, 4.5vw, 64px);
  color-scheme: light;
}

[data-hn-theme='dark'] {
  --hn-bg: #1c1c1c;
  --hn-fg: #f1f1ef;
  --hn-muted: #b9c3b2;
  --hn-surface: #292d25;
  --hn-action-bg: #a8c84b;
  --hn-action-fg: #1c1c1c;
  --hn-line: #41483b;
  --hn-focus: #a8c84b;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 32px;
  -webkit-text-size-adjust: 100%;
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--hn-bg);
  color: var(--hn-fg);
  font-family: Schibsted, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  font-synthesis: none;
}

h1, h2, h3, p, figure {
  margin: 0;
}

h1, h2, h3, strong {
  font-weight: 500;
}

h2 {
  font-size: clamp(38px, 4.5vw, 64px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

h3 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.2;
  letter-spacing: -.035em;
}

a {
  color: inherit;
}

button, select, input {
  font: inherit;
}

button, a, summary {
  touch-action: manipulation;
}

button, .button {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

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

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 3px solid var(--hn-focus);
  outline-offset: 5px;
  border-radius: 3px;
}

.wrap {
  width: min(calc(100% - 2 * var(--hn-gutter)), var(--hn-wrap));
  margin-inline: auto;
}

.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: normal;
  border: 0;
}

.skip:focus {
  position: fixed;
  z-index: 30;
  top: 12px;
  left: 12px;
  background: var(--hn-bg);
  padding: 12px 20px;
}

.enhanced {
  visibility: hidden;
}

html.is-ready .enhanced {
  visibility: visible;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hn-muted);
}

.seed {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--hn-action-bg);
  border-radius: 50%;
}

.period {
  color: var(--hn-action-bg);
}

/* Navigation and shared controls. */
.nav {
  height: 88px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.wordmark {
  display: block;
  margin-right: auto;
  width: 128px;
}

.wordmark img {
  width: 128px;
  height: 40px;
  object-fit: contain;
  object-position: left center;
}

.mark-dark,
[data-hn-theme='dark'] .mark-light {
  display: none;
}

[data-hn-theme='dark'] .mark-dark {
  display: block;
}

.nav nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
}

.nav nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left calc(100% - 9px) / 0 1px no-repeat;
  transition: background-size var(--hn-time-feedback) var(--hn-ease);
}

.icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hn-line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  transition: transform var(--hn-time-press) var(--hn-ease);
}

.theme-sun,
[data-hn-theme='dark'] .theme-moon {
  display: none;
}

[data-hn-theme='dark'] .theme-sun {
  display: block;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 52px;
  padding: 13px 24px;
  border-radius: 100px;
  font-size: 16px;
  text-decoration: none;
  transition: transform var(--hn-time-press) var(--hn-ease),
    background-color var(--hn-time-feedback) var(--hn-ease);
}

.primary {
  background: var(--hn-action-bg);
  color: var(--hn-action-fg);
}

/* A content-sized introduction, with a fixed-size optional companion. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 32px 64px;
  padding-block: 56px 40px;
}

.hero-copy {
  min-width: 0;
  max-width: 900px;
}

.hero h1 {
  margin-top: 24px;
  font-size: clamp(48px, 5.9vw, 88px);
  letter-spacing: -.065em;
  line-height: 1.07;
  overflow-wrap: normal;
  text-wrap: balance;
}

.hero-intro {
  max-width: 58ch;
  margin-top: 24px;
  font-size: 22px;
  line-height: 1.6;
  color: var(--hn-muted);
}

.hero-copy > .button {
  margin-top: 28px;
}

.hero-companion {
  width: 220px;
  align-self: center;
  justify-self: end;
  pointer-events: auto;
}

.original-character {
  position: relative;
  display: block;
  aspect-ratio: 1;
}

.original-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.moth-greeting {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  line-height: 1;
}

.moth-greeting:disabled {
  cursor: default;
}

/* Reserve the cue's line even when JavaScript or the rig is unavailable. */
.greeting-cue {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  text-underline-offset: 4px;
  color: var(--hn-muted);
  visibility: hidden;
}

html.is-ready .moth-greeting:not(:disabled) .greeting-cue {
  visibility: visible;
}

.hero-work {
  grid-column: 1 / -1;
  border-top: 1px solid var(--hn-line);
  padding-top: 20px;
}

.hero-work-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.hero-work-links a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  gap: 6px 16px;
  min-height: 64px;
  text-decoration: none;
}

.hero-work-links a > span:first-child {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--hn-muted);
}

.hero-work-links strong {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
}

.hero-work-links a > span:last-child {
  font-size: 18px;
}

/* Work stories; each visual owns its scoped styling in StoryVisual.astro. */
.workbench {
  padding-block: 64px 72px;
  background: var(--hn-surface);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 56px;
  align-items: end;
}

.section-head .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}

.section-head > p:last-child {
  max-width: 35ch;
  margin-left: 32px;
  margin-bottom: 3px;
  font-size: 18px;
  color: var(--hn-muted);
}

.stories {
  margin-top: 32px;
}

.story {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(0, .8fr);
  gap: 32px;
  border-top: 1px solid var(--hn-line);
  padding-block: 32px;
}

.story-number {
  padding-top: 3px;
  font-size: 14px;
  color: var(--hn-muted);
  font-variant-numeric: tabular-nums;
}

.story-kind {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--hn-muted);
}

.story-copy > p:not(.story-kind) {
  max-width: 48ch;
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.7;
}

.story-study {
  min-width: 0;
}

.maker-choice {
  max-width: 48ch;
  margin-top: 20px;
  padding-left: 14px;
  border-left: 1px solid var(--hn-action-bg);
}

.maker-choice p {
  font-size: 16px;
  line-height: 1.65;
}

.maker-choice > .maker-choice-label,
.maker-choice > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hn-muted);
}

.story details {
  max-width: 48ch;
  margin-top: 20px;
}

.story summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: max-content;
  max-width: 100%;
  min-width: 190px;
  min-height: 44px;
  border-bottom: 1px solid var(--hn-line);
  font-size: 14px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.story summary::-webkit-details-marker {
  display: none;
}

.story summary span {
  font-size: 22px;
  font-weight: 400;
}

.story details[open] summary span {
  transform: rotate(45deg);
}

.notebook {
  padding-top: 20px;
  font-size: 16px;
  line-height: 1.7;
}

.notebook p + p {
  margin-top: 16px;
}

.notebook .notebook-question {
  font-size: 20px;
  line-height: 1.4;
  color: var(--hn-fg);
  font-weight: 500;
}

.notebook .status-line {
  border-left: 2px solid var(--hn-action-bg);
  padding-left: 12px;
  font-size: 13px;
  color: var(--hn-muted);
}

.notebook .source-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 12px;
  font-size: 14px;
  text-underline-offset: 4px;
}

.open-question {
  display: flex;
  gap: 32px;
  max-width: 850px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--hn-line);
}

.open-question > span {
  font-size: 28px;
  line-height: 1.2;
  color: var(--hn-muted);
}

.open-question > p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--hn-muted);
}

.open-question strong {
  color: var(--hn-fg);
  font-weight: 400;
}

/* Personal context and original park artwork. */
.about {
  padding-top: 80px;
}

.about-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 56px;
}

.about-heading .eyebrow {
  grid-column: 1 / -1;
}

.about-copy {
  max-width: 45ch;
  padding-left: 32px;
  font-size: 18px;
  color: var(--hn-muted);
}

.about-copy p + p {
  margin-top: 16px;
}

.park-frame {
  margin-top: 40px;
  border-radius: 18px;
  overflow: hidden;
}

.park-frame img {
  width: 100%;
  height: auto;
}

.about-close {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding-block: 40px 64px;
}

.about-close p {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.footer {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  padding-block: 40px 32px;
  border-top: 1px solid var(--hn-line);
}

.footer-name {
  font-size: 58px;
  line-height: 1;
  letter-spacing: -.06em;
  font-weight: 500;
  text-decoration: none;
}

.footer > div {
  justify-self: end;
  font-size: 14px;
  color: var(--hn-muted);
}

.footer > div p + p {
  margin-top: 6px;
}

.site-notes {
  grid-column: 1 / -1;
  max-width: 70ch;
  font-size: 13px;
  color: var(--hn-muted);
}

.site-notes summary {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.site-notes summary::-webkit-details-marker {
  display: none;
}

.site-notes p + p {
  margin-top: 12px;
}

.site-notes a {
  text-underline-offset: 3px;
}

/* Tablet layout retains the compact companion without viewport-height spacing. */
@media (max-width: 1050px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 180px;
    column-gap: 32px;
  }

  .hero h1 {
    font-size: 60px;
  }

  .hero-companion {
    width: 180px;
  }

  .hero-work-links {
    gap: 24px;
  }

  .story {
    grid-template-columns: 24px minmax(0, 1fr) minmax(0, .7fr);
    gap: 24px;
  }

  .section-head > p:last-child {
    margin-left: 0;
  }

  .about-copy {
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .nav {
    height: 80px;
    gap: 16px;
  }

  .nav nav {
    gap: 20px;
  }

  .nav nav .github-link {
    display: none;
  }

  .wordmark, .wordmark img {
    width: 112px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 28px 12px;
    padding-block: 24px 32px;
  }

  .hero-copy {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .hero-copy > .eyebrow {
    max-width: calc(100% - 108px);
    min-height: 124px;
  }

  .hero h1 {
    margin-top: 16px;
    font-size: clamp(48px, 8vw, 68px);
  }

  .hero-intro {
    margin-top: 20px;
    font-size: 18px;
  }

  .hero-copy > .button {
    margin-top: 24px;
  }

  .hero-companion {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: 96px;
  }

  .hero-work-links {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-work-links a {
    min-height: 72px;
    padding-block: 12px;
    border-bottom: 1px solid var(--hn-line);
  }

  .hero-work-links a:last-child {
    border-bottom: 0;
  }

  .hero-work-links strong {
    font-size: 16px;
  }

  .workbench {
    padding-block: 48px 56px;
  }

  .section-head, .about-heading {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-head .eyebrow {
    margin-bottom: 0;
  }

  .section-head > p:last-child {
    margin: 0;
    font-size: 17px;
  }

  .section-head > p:last-child br {
    display: none;
  }

  .stories {
    margin-top: 24px;
  }

  .story {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 20px;
    padding-block: 28px;
  }

  .story-copy > p:not(.story-kind) {
    font-size: 16px;
  }

  .open-question {
    gap: 20px;
  }

  .open-question > p {
    font-size: 16px;
  }

  .about {
    padding-top: 64px;
  }

  .about-copy {
    max-width: 48ch;
    font-size: 17px;
  }

  .park-frame {
    margin-top: 32px;
    border-radius: 10px;
  }

  .about-close {
    flex-direction: column;
    align-items: start;
    padding-block: 32px 48px;
  }

  .about-close p {
    font-size: 25px;
  }

  .footer {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-name {
    font-size: 48px;
  }

  .footer > div {
    justify-self: start;
  }

  .site-notes {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .nav {
    gap: 12px;
  }

  .nav nav {
    gap: 14px;
    font-size: 13px;
  }

  .wordmark, .wordmark img {
    width: 96px;
  }

  .hero h1 {
    font-size: 49px;
  }

  .eyebrow {
    font-size: 12px;
  }

  .hero-copy > .button {
    width: 100%;
  }

  .story summary {
    min-width: 180px;
  }

  .footer > div {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .wordmark, .wordmark img {
    width: 80px;
  }

  .nav nav {
    gap: 10px;
    font-size: 12px;
  }

  .nav nav a {
    white-space: nowrap;
  }
}

/* Pointer feedback never adds a transform to the character container. */
@media (hover: hover) and (pointer: fine) {
  .nav nav a:hover {
    background-size: 100% 1px;
  }

  .button:hover {
    transform: translateY(-2px);
  }

  .icon-button:hover {
    background: var(--hn-surface);
  }

  .story summary:hover {
    border-color: var(--hn-fg);
  }

  .hero-work-links a:hover strong {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .moth-greeting:not(:disabled):hover .greeting-cue {
    color: var(--hn-fg);
    text-decoration: underline;
  }
}

button:active:not(:focus-visible), .button:active:not(:focus-visible) {
  transform: scale(.97);
}

.moth-greeting:active:not(:focus-visible) {
  transform: none;
}

.button:focus-visible, .icon-button:focus-visible {
  transition: none;
}

.moth-greeting:not(:disabled):active .greeting-cue {
  color: var(--hn-fg);
  text-decoration: underline;
}

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

  .button:hover, button:active:not(:focus-visible), .button:active:not(:focus-visible) {
    transform: none;
  }
}

@media (forced-colors: active) {
  .button, .icon-button {
    border: 1px solid ButtonText;
  }

  .period {
    color: CanvasText;
  }
}
