/* First paint: the desk, the fonts and the sheet, so the board is already there before the
   module loads. Everything interactive is in src/style.css. */

@font-face {
  font-family: "Cabinet";
  src: url("/fonts/CabinetGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet";
  src: url("/fonts/CabinetGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet";
  src: url("/fonts/CabinetGrotesk-Extrabold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Erode";
  src: url("/fonts/Erode-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Erode";
  src: url("/fonts/Erode-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Sligoil";
  src: url("/fonts/Sligoil-Micro.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --desk: #241a07;
  --desk-deep: #120c03;
  --sheet: #0e0e0e;
  --sheet-card: #141414;
  --cream: #f2efe7;
  --cream-dim: #d8d2c2;
  --ink: #0e0e0e;
  --gold: #e0a93b;
  --gold-pale: #f4d693;
  --gold-dim: #a4834a;
  --gold-deep: #6d4d10;
  --hair: rgba(242, 239, 231, 0.2);
  --hair-ink: rgba(14, 14, 14, 0.18);

  --sans: "Cabinet", ui-sans-serif, system-ui, sans-serif;
  --serif: "Erode", Georgia, serif;
  --mono: "Sligoil", ui-monospace, "SF Mono", monospace;

  --gut: clamp(18px, 2.6vw, 52px);
  --sheet-top: clamp(78px, 7.4vw, 100px);
  --step: clamp(46px, 4.2vw, 62px);
  --band: clamp(46px, 3.6vw, 60px);
  --notch: clamp(15px, 1.35vw, 24px);
  --radius: clamp(24px, 2.6vw, 44px);

  --t-body: clamp(17px, 1.05vw, 19px);
  --t-small: clamp(16px, 0.95vw, 17px);
  --t-label: clamp(17px, 1.05vw, 19px);
  --t-card-head: clamp(24px, 1.8vw, 34px);
  --t-section: clamp(34px, 3.5vw, 60px);
  --t-figure: clamp(50px, 5.6vw, 100px);
  --t-hero: clamp(56px, 6.6vw, 122px);
  --t-mint: clamp(16px, 1.35vw, 25px);

  color-scheme: dark;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--desk);
  color: var(--cream);
  font: 500 var(--t-body) / 1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------- the desk */

.desk {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 78% 8%, #3b2a0b 0%, var(--desk) 42%, var(--desk-deep) 100%);
}
.desk-dust {
  position: absolute;
  inset: -12%;
  background: url("/img/dust.webp") center / cover no-repeat;
  opacity: 0.4;
  filter: blur(26px) saturate(1.1);
  animation: dust-drift 74s ease-in-out infinite alternate;
}
.desk-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 45% at 50% -6%, rgba(224, 169, 59, 0.3), transparent 70%);
}
@keyframes dust-drift {
  from {
    transform: translate3d(-3%, -2%, 0) scale(1.06);
  }
  to {
    transform: translate3d(4%, 3%, 0) scale(1.14);
  }
}

/* ---------------------------------------------------------------- the board */

.board {
  position: relative;
  z-index: 1;
  padding: 0;
}

.byline {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--sheet-top);
  padding-left: var(--gut);
}
.board a {
  text-decoration: none;
}
.byline-mark {
  width: clamp(40px, 3vw, 56px);
  height: clamp(40px, 3vw, 56px);
  border-radius: 14px;
  display: block;
}
.byline-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.byline-lines b {
  font: 700 clamp(19px, 1.35vw, 24px) / 1.1 var(--sans);
  color: var(--cream);
  letter-spacing: -0.01em;
}
.byline-lines i {
  font: 400 var(--t-small) / 1.3 var(--mono);
  color: var(--gold-pale);
  font-style: normal;
  letter-spacing: 0.02em;
}

/* The nav: folder tabs that peek out from behind the sheet's top edge. */
.tabs {
  position: absolute;
  left: clamp(220px, 21vw, 420px);
  right: var(--gut);
  top: 12px;
  height: calc(var(--sheet-top) - 14px);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.tab {
  position: relative;
  text-decoration: none;
  pointer-events: auto;
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 6px clamp(20px, 1.8vw, 32px) 20px;
  height: calc(var(--sheet-top) - 26px);
  min-height: 48px;
  color: var(--ink);
  font: 700 var(--t-label) / 1 var(--sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  transition: transform 0.16s ease, height 0.16s ease;
}
.tab canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.tab:hover {
  transform: translateY(-3px);
}
.tab[aria-current="page"] {
  height: calc(var(--sheet-top) - 16px);
  color: var(--ink);
}
.tab:focus-visible {
  outline: 3px solid var(--gold-pale);
  outline-offset: 3px;
}

.sheet {
  position: relative;
  min-height: 60vh;
  padding: 0 0 clamp(40px, 4vw, 96px);
}
.sheet > canvas.sheet-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.sheet-title {
  position: absolute;
  right: clamp(24px, 2.6vw, 52px);
  top: 0;
  height: var(--step);
  display: flex;
  align-items: center;
  font: 800 clamp(17px, 1.3vw, 23px) / 1 var(--sans);
  letter-spacing: 0.02em;
  color: var(--cream);
  z-index: 2;
}
.view {
  position: relative;
  z-index: 1;
  max-width: 1820px;
  margin: 0 auto;
  padding: calc(var(--step) + clamp(26px, 2.6vw, 52px)) clamp(20px, 3vw, 60px) 0;
}

@media (max-width: 900px) {
  .tabs {
    position: static;
    height: auto;
    margin: 0 0 -2px;
    flex-wrap: wrap;
    gap: 6px 6px;
  }
  /* The tabs share each row edge to edge instead of leaving a ragged gap at the end. */
  .tab,
  .tab[aria-current="page"] {
    height: 56px;
    padding: 4px 18px 8px;
    flex: 1 1 auto;
    justify-content: center;
  }
  .view {
    padding-top: calc(var(--step) + 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .desk-dust {
    animation: none;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
