:root {
  --paper: #f6f2ea;
  --surface: rgba(255, 255, 255, 0.6);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --ink: #10100f;
  --ink-soft: #3b3833;
  --muted: #70695f;
  --rule: #d9d1c4;
  --rule-strong: #c8bfb1;
  --button-dark: #141413;
  --container: min(1280px, calc(100vw - 56px));
  --section-gap: clamp(1.8rem, 3vw, 2.8rem);
  --section-pad: clamp(4.2rem, 7vw, 7.4rem);
  --hero-pad: clamp(1rem, 2.6vw, 1.8rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", sans-serif;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.58), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.18), transparent 26%);
  opacity: 0.9;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.045em;
}

.page-shell {
  position: relative;
  width: var(--container);
  margin: 0 auto;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
  transition:
    background-color 220ms ease,
    backdrop-filter 220ms ease,
    border-color 220ms ease,
    padding 220ms ease;
}

body.is-scrolled .topbar {
  background: rgba(246, 242, 234, 0.9);
  backdrop-filter: blur(14px);
  border-color: rgba(200, 191, 177, 0.6);
  padding: 0.3rem 0;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 58px;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brandmark__logo {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.45);
  transform-origin: left;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

main {
  padding-bottom: 2rem;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(118px, 140px) minmax(0, 1fr);
  gap: var(--section-gap);
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--rule);
}

.section-tag,
.eyebrow,
.card__label {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-tag {
  margin: 0;
  padding-top: 0.35rem;
  font-size: 0.66rem;
  color: var(--muted);
}

.eyebrow,
.card__label {
  font-size: 0.68rem;
  color: var(--muted);
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(118px, 140px) minmax(0, 1fr);
  gap: var(--section-gap);
  padding: var(--hero-pad) 0 var(--section-pad);
  min-height: min(620px, calc(100vh - 92px));
}

.page-hero__content {
  display: grid;
  gap: 1.5rem;
  align-content: end;
  max-width: 54rem;
}

.page-hero h1 {
  max-width: 10ch;
  font-size: clamp(3.8rem, 9vw, 7rem);
  line-height: 0.94;
  font-weight: 600;
}

.page-hero h1 span {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
}

.page-hero__lede {
  max-width: 34rem;
  font-size: clamp(1.03rem, 2vw, 1.14rem);
  line-height: 1.76;
  color: var(--ink-soft);
}

.section-block {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--rule);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--rule-strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--ink);
}

.button--primary {
  background: var(--button-dark);
  border-color: var(--button-dark);
  color: var(--paper);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: #000;
  color: var(--paper);
}

.button--secondary {
  background: transparent;
  color: var(--ink);
}

.card-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.detail-card,
.stack-list__item,
.fit-form label,
.fit-form__full {
  display: grid;
  gap: 0.8rem;
  padding: 1.1rem;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.08);
}

.card h2,
.stack-list__item h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.02;
  font-weight: 600;
}

.card p,
.detail-card p,
.stack-list__item p {
  line-height: 1.75;
  color: var(--ink-soft);
}

.stack-list {
  display: grid;
  gap: 1rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0 2.2rem;
  border-top: 1px solid var(--rule);
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.footer__meta {
  display: grid;
  gap: 0.15rem;
}

.footer__title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer__meta p:last-child {
  color: var(--muted);
  font-size: 0.94rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.3rem;
}

.footer__nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-reveal] {
  opacity: 1;
  transform: none;
}

[data-reveal].is-visible {
  animation: rise-in 420ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1080px) {
  .section-grid,
  .page-hero {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --container: min(100vw - 28px, 100%);
    --section-pad: 3.4rem;
    --hero-pad: 0.7rem;
  }

  .page-hero h1 {
    max-width: 100%;
    font-size: clamp(3rem, 16vw, 5.2rem);
  }

  .button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
