/* angusbuilds.com — page shell styles.
   thijs.net look (warm paper, stacked white cards) adapted per spec §2, with our own
   card-seam treatment (full rounding + alternating tilt) instead of a pixel port of
   thijs's flush-stacked shape() dividers. */

@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-variable-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Mono';
  src: url('assets/fonts/spacemono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Mono';
  src: url('assets/fonts/spacemono-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #faf9f6;
  --card: #fff;
  --ink: #1f2937;
  --ink-muted: #5b6472;
  --rule: rgba(31, 41, 55, 0.08);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --nav-h: 74px;
  --radius-card: 24px;
  --shadow-card: 0 1px 2px rgba(31, 41, 55, 0.05), 0 18px 40px -22px rgba(31, 41, 55, 0.28);
  /* Default so filter: grayscale(var(--video-grayscale)) is valid before mount.js ticks. */
  --video-grayscale: 0;
}

@media (max-width: 640px) {
  :root {
    --radius-card: 20px;
  }
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

.sc-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Nav ---------- */

.sc-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(16px, 4vw, 48px);
  transition: box-shadow 0.2s ease;
}

.sc-nav.sc-scrolled {
  box-shadow: 0 1px 0 var(--rule);
}

@media (prefers-reduced-motion: reduce) {
  .sc-nav {
    transition: none;
  }
}

.sc-nav__brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
}

.sc-nav__replay {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  cursor: pointer;
  flex: none;
}

.sc-nav__replay svg {
  width: 18px;
  height: 18px;
}

.sc-nav__replay:hover {
  background: #f0eee8;
}

.sc-nav__links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.sc-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink);
}

.sc-nav__icon {
  display: none;
}

@media (max-width: 640px) {
  /* Keep the words on phones — a bare glyph is not a label. Smaller, with a real tap area. */
  .sc-nav__text {
    font-size: 0.8rem;
  }
  .sc-nav__link {
    min-height: 44px;
    padding-inline: 4px;
  }
  .sc-nav__links {
    gap: 0.9rem;
  }
}

/* ---------- Stage + sheet ---------- */

.sc-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  z-index: 0;
  background: #fff;
  overflow: hidden;
}

.sc-stage__canvas {
  position: absolute;
  inset: 0;
}

.sc-stage__letters {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  padding-top: var(--nav-h);
}

.sc-stage__letter {
  /* Positioned over each drawn letter by the stage every frame; invisible until focused. */
  position: absolute;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  opacity: 0;
}
.sc-stage__letter:focus-visible {
  opacity: 1 !important;
  outline: 3px solid #4e8df6;
  outline-offset: 6px;
}

.sc-sheet {
  position: relative;
  z-index: 2;
  margin-top: -64px;
  /* The tilted panels overhang their box by a few px; never let that become a horizontal scroll. */
  overflow-x: clip;
}

@media (max-width: 640px) {
  .sc-panel {
    --tilt: 0deg !important;
  }
}

.sc-content {
  max-width: 1152px;
  margin-inline: auto;
  padding-inline: 24px;
}

@media (max-width: 767px) {
  .sc-content {
    padding-inline: 12px;
  }
}

/* ---------- Panels (the big stacked white cards) ---------- */
/* Card seams: own treatment — full rounding + a soft shadow + a 0.6deg alternating tilt.
   The panel carries the tilt; its __inner wrapper carries the opposite rotation so the
   reading content stays level while the card's silhouette reads as a scattered stack. */

.sc-panel {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-block: 20px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.25s ease;
}

.sc-panel:first-of-type {
  margin-top: 0;
}

.sc-panel:nth-of-type(odd) {
  --tilt: -0.6deg;
}

.sc-panel:nth-of-type(even) {
  --tilt: 0.6deg;
}

@media (prefers-reduced-motion: reduce) {
  .sc-panel {
    transition: none;
  }
}

.sc-panel__inner {
  transform: rotate(calc(var(--tilt, 0deg) * -1));
  padding: clamp(24px, 4vw, 44px);
}

/* ---------- Banner ---------- */

.sc-panel--banner {
  overflow: visible;
  padding: 0;
}

.sc-banner {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1152 / 344;
  min-height: 280px;
  border-radius: inherit;
  overflow: hidden;
  background: #fff;
}

.sc-banner__stage {
  position: absolute;
  inset: 0;
}

.sc-banner__scrim {
  display: none;
}

.sc-banner__text {
  position: absolute;
  left: clamp(20px, 4vw, 44px);
  /* Sits a little lower so the fixed nav never covers the name at the scroll landing. */
  top: clamp(28px, 5vw, 56px);
  max-width: 60%;
}

.sc-banner__h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.05;
  color: var(--ink);
}

.sc-banner__tagline {
  margin: 0.6em 0 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: #666;
}

.sc-avatar {
  position: absolute;
  right: clamp(16px, 4vw, 40px);
  bottom: -36px;
  width: 128px;
  height: 128px;
}

@media (max-width: 640px) {
  /* Narrow cards: a one-line name and a smaller avatar so neither crowds the looping scene. */
  .sc-banner__h1 {
    font-size: 30px;
  }
  .sc-banner__text {
    max-width: 80%;
  }
  .sc-avatar {
    width: 84px;
    height: 84px;
    bottom: -24px;
  }
}

.sc-avatar__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: sc-spin 18s linear infinite;
}

@keyframes sc-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-avatar__ring {
    animation: none;
  }
}

.sc-avatar__ring-text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  fill: var(--ink);
}

.sc-avatar__plate {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e3d6be, #cbbb9c);
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.2);
}

/* ---------- About ---------- */

.sc-panel--about h2,
.sc-panel--blog h2,
.sc-panel--projects h2 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
}

.sc-about__intro {
  margin: 0 0 1.25em;
  line-height: 1.6;
}

.sc-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-bottom: 1.25em;
  font-size: 0.92rem;
}

.sc-timeline__row {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
}

.sc-timeline__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
  flex: none;
}

.sc-timeline__dot--now {
  background: #3fae6a;
}

.sc-timeline__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  flex: none;
}

.sc-highlights {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  font-size: 0.95rem;
}

.sc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
}

.sc-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 1em;
  border-radius: 999px;
  background: var(--ground);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink);
}

.sc-pill--tbd {
  color: var(--ink-muted);
  font-style: italic;
}

/* ---------- Card intro line (blog/projects) ---------- */

.sc-card__intro {
  margin: 0 0 1.25em;
  color: var(--ink-muted);
}

/* ---------- Project cards (CARDS.md contract) ---------- */

.sc-projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.sc-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.sc-card--wide {
  aspect-ratio: 16 / 10;
}

.sc-card__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #e8e4da;
}

.sc-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-card__plate {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ece7da, #d9d2c0);
}

.sc-card__year {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 0.25em 0.6em;
  border-radius: 999px;
}

.sc-card__star {
  /* Dark amber on a white chip: the bare yellow star measured 1.26:1 on the plate. */
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #8a5a00;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.sc-card__label {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 0.65em 0.85em;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.sc-card__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}

.sc-card__sub {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-muted);
  /* Two lines max: long repo descriptions were pushing the label out of the card on phones. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Blog posts (CARDS.md contract) ---------- */

.sc-blog__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.sc-post {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35em;
  min-height: 150px;
  border-radius: 16px;
  padding: 1rem;
  text-decoration: none;
  color: var(--ink);
}

.sc-post--a {
  background: #f9d4d7;
}

.sc-post--b {
  background: #ffe1b8;
}

.sc-post__date {
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.7;
}

.sc-post__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
}

.sc-post__excerpt {
  font-family: var(--sans);
  font-size: 0.85rem;
  opacity: 0.85;
}

@media (max-width: 640px) {
  /* Projects stay two-up on phones so the list scans instead of scrolling forever. */
  .sc-projects__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .sc-card--wide {
    grid-column: span 2;
  }
  .sc-card__title {
    font-size: 0.95rem;
  }
  .sc-card__sub {
    font-size: 0.72rem;
  }
  .sc-blog__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */

.sc-footer {
  text-align: center;
  padding: 40px 24px 64px;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.sc-footer p {
  margin: 0 0 0.6em;
}

.sc-footer__trademark {
  max-width: 56ch;
  margin-inline: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
}
