@import url("vars.css");

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

::-moz-selection {
  background: var(--yellow);
  color: var(--ink);
}

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

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(228, 28, 18, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(255, 230, 0, 0.12), transparent 50%),
    linear-gradient(180deg, #1f1712 0%, var(--bg) 40%, #120e0b 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 600;
  border-radius: 4px;
}

.skip-link:focus {
  top: 12px;
}

/* —— Vertical station letters —— */
.rail-letters {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail-width);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
  border-right: 3px solid var(--yellow);
}

.rail-letters__word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08em;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  letter-spacing: 0.08em;
  color: var(--yellow);
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
}

.rail-letters__word span {
  display: block;
  opacity: 0;
  transform: translateY(12px);
  animation: letterDrop 0.7s var(--ease-out) forwards;
}

.rail-letters__word span:nth-child(1) { animation-delay: 0.15s; }
.rail-letters__word span:nth-child(2) { animation-delay: 0.25s; }
.rail-letters__word span:nth-child(3) { animation-delay: 0.35s; }
.rail-letters__word span:nth-child(4) { animation-delay: 0.45s; }
.rail-letters__word span:nth-child(5) { animation-delay: 0.55s; }

@keyframes letterDrop {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-left: var(--rail-width);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(26, 20, 16, 0.92), rgba(26, 20, 16, 0.7));
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark__logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 2px solid var(--yellow);
  flex-shrink: 0;
}

.brand-mark__text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--yellow);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: flex-end;
}

.site-nav a {
  padding: 8px 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--yellow);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--yellow);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--yellow), var(--gold));
  color: var(--ink);
  border: 2px solid transparent;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
  box-shadow: 0 8px 24px rgba(255, 230, 0, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(255, 230, 0, 0.32);
}

.btn--ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(255, 248, 231, 0.35);
  box-shadow: none;
}

.btn--ghost:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: none;
}

/* —— Hero —— */
.hero {
  position: relative;
  margin-left: var(--rail-width);
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(20, 14, 10, 0.72) 0%, rgba(20, 14, 10, 0.35) 45%, rgba(20, 14, 10, 0.55) 100%),
    linear-gradient(0deg, rgba(20, 14, 10, 0.92) 0%, rgba(20, 14, 10, 0.2) 45%, rgba(20, 14, 10, 0.45) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) var(--gutter) clamp(48px, 8vw, 88px);
}

.hero__brand {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--yellow);
  text-shadow: 0 4px 0 var(--red), 0 10px 40px rgba(0, 0, 0, 0.45);
  margin-bottom: 18px;
  max-width: 12ch;
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 0.9s var(--ease-out) 0.2s forwards;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--cream);
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: riseIn 0.9s var(--ease-out) 0.4s forwards;
}

.hero__lede {
  max-width: 38ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn 0.9s var(--ease-out) 0.55s forwards;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn 0.9s var(--ease-out) 0.7s forwards;
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  z-index: 2;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--yellow);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  opacity: 0.8;
  animation: scrollPulse 2.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(6px); }
}

/* —— Sections —— */
.section {
  margin-left: var(--rail-width);
  padding: var(--section) var(--gutter);
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-right: auto;
  position: relative;
}

.section--split {
  display: grid;
  grid-template-columns: auto 1.2fr 0.9fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.section__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05em;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: 0.06em;
  color: var(--red);
  line-height: 1;
  padding-top: 8px;
}

.section__rail--accent {
  color: var(--yellow);
}

.section__copy h2,
.spike-story h2,
.contact-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: var(--cream);
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 10px;
}

.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 48ch;
  margin-bottom: 14px;
}

.lede--soft {
  color: rgba(212, 196, 168, 0.78);
}

.section__copy--center {
  text-align: center;
  margin: 0 auto 40px;
}

.section__copy--center .lede {
  margin-left: auto;
  margin-right: auto;
}

.section__figure {
  margin: 0;
}

.section__logo {
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  border: 3px solid var(--yellow);
  box-shadow:
    8px 8px 0 var(--red),
    var(--shadow);
}

/* —— Lego band —— */
.section--band {
  max-width: none;
  margin-right: 0;
  padding-left: calc(var(--rail-width) + var(--gutter));
  margin-left: 0;
  background:
    linear-gradient(135deg, rgba(228, 28, 18, 0.16), rgba(255, 230, 0, 0.06)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 230, 0, 0.03) 18px,
      rgba(255, 230, 0, 0.03) 19px
    );
  border-block: 1px solid var(--line);
}

.section__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.build-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
  border-top: 1px solid var(--line);
  padding-top: 36px;
}

.build-list__item {
  position: relative;
  padding-top: 8px;
}

.build-list__index {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--red);
  line-height: 1;
  display: block;
  margin-bottom: 10px;
}

.build-list__item h3 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  color: var(--yellow);
  margin-bottom: 8px;
}

.build-list__item p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* —— Spike —— */
.section--spike {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.spike-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.spike-quote {
  margin-top: 28px;
  padding: 24px 0 0;
  border-top: 3px solid var(--yellow);
  max-width: 40ch;
}

.spike-quote p {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.45;
  color: var(--cream);
  font-weight: 500;
}

.spike-portrait {
  margin: 0;
  justify-self: end;
  width: min(100%, 420px);
}

.spike-portrait__frame {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--yellow);
  box-shadow:
    10px 10px 0 var(--red),
    var(--shadow);
  background: #8a6b64;
}

.spike-portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 55%, rgba(228, 28, 18, 0.18));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.spike-portrait.is-visible .spike-portrait__frame::after {
  opacity: 1;
}

.spike-portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 60% center;
  display: block;
  transform: scale(1.08);
  transition: transform 1.4s var(--ease-out);
}

.spike-portrait.is-visible img {
  transform: scale(1);
  animation: spikeDrift 14s ease-in-out 1.2s infinite alternate;
}

@keyframes spikeDrift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.04) translate3d(-1.5%, -1%, 0); }
}

.spike-portrait figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .spike-portrait.is-visible img {
    animation: none;
    transform: none;
  }
}

/* —— Hobbies —— */
.hobby-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 40px);
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.hobby {
  padding: 0;
  border: none;
}

.hobby h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  color: var(--yellow);
  margin-bottom: 10px;
}

.hobby p {
  color: var(--text-muted);
  max-width: 28ch;
}

/* —— Scrollbar —— */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--yellow) var(--ink-soft);
}

html::-webkit-scrollbar {
  width: 12px;
}

html::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 50%, var(--ink) 100%);
  border-left: 1px solid rgba(228, 28, 18, 0.35);
}

html::-webkit-scrollbar-thumb {
  background:
    linear-gradient(
      180deg,
      var(--yellow) 0%,
      var(--gold) 35%,
      var(--red) 70%,
      var(--red-deep) 100%
    );
  background-size: 100% 200%;
  border: 2px solid var(--ink);
  border-radius: 999px;
  animation: scrollbarPulse 2.8s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.35);
}

html::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      180deg,
      #fff36a 0%,
      var(--yellow) 40%,
      var(--red) 100%
    );
  box-shadow: 0 0 18px rgba(255, 230, 0, 0.55);
  animation: scrollbarPulse 1.4s ease-in-out infinite;
}

html::-webkit-scrollbar-thumb:active {
  background: var(--red);
}

@keyframes scrollbarPulse {
  0%, 100% {
    background-position: 0% 0%;
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.3);
  }
  50% {
    background-position: 0% 100%;
    box-shadow: 0 0 18px rgba(228, 28, 18, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  html::-webkit-scrollbar-thumb {
    animation: none;
  }
}

/* —— Contact —— */
.section--contact {
  padding-bottom: calc(var(--section) * 1.1);
}

.contact-panel {
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 3px solid var(--red);
  border-bottom: 3px solid var(--yellow);
}

/* —— Reveal on scroll —— */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Footer —— */
.site-footer {
  margin-left: var(--rail-width);
  border-top: 1px solid var(--line);
  padding: 36px var(--gutter) 48px;
  background: rgba(0, 0, 0, 0.25);
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.site-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
}

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.site-footer__social a {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--yellow);
  text-decoration: none;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

.site-footer__social a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}

.site-footer__social a:hover {
  color: var(--cream);
}

.site-footer__social a:hover::after,
.site-footer__social a:focus-visible::after {
  transform: scaleX(1);
}

.site-footer__credit {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--cream);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding-bottom: 6px;
  transition: opacity 0.25s ease;
}

.site-footer__credit::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}

.site-footer__credit:hover {
  opacity: 0.95;
}

.site-footer__credit:hover::after,
.site-footer__credit:focus-visible::after {
  transform: scaleX(1);
}

.site-footer__credit-text {
  white-space: nowrap;
}

.site-footer__logo {
  display: block;
  width: clamp(88px, 14vw, 118px);
  height: auto;
}

.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;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.site-footer__legal a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__legal a:hover {
  color: var(--yellow);
}

@media (max-width: 640px) {
  .site-footer__credit {
    margin-left: 0;
  }
}

/* —— Legal pages —— */
.legal-page {
  margin-left: var(--rail-width);
  max-width: 720px;
  padding: var(--section) var(--gutter);
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: 0.03em;
  color: var(--yellow);
  margin-bottom: 12px;
}

.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--cream);
  margin: 32px 0 10px;
}

.legal-page p,
.legal-page li {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-page ul {
  padding-left: 1.2rem;
  margin-bottom: 16px;
}

.legal-page a {
  color: var(--yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.9em;
  color: var(--yellow);
}

.legal-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .section--split {
    grid-template-columns: auto 1fr;
  }

  .section__figure {
    grid-column: 2;
  }

  .build-list,
  .hobby-strip,
  .spike-layout {
    grid-template-columns: 1fr;
  }

  .spike-portrait {
    justify-self: start;
    width: min(100%, 380px);
  }

  .hobby {
    padding: 0;
  }
}

@media (max-width: 780px) {
  :root {
    --rail-width: 36px;
  }

  .rail-letters__word {
    font-size: 1.15rem;
  }

  .brand-mark__text {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 12px var(--gutter) 20px;
    background: rgba(26, 20, 16, 0.97);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-header__inner {
    position: relative;
  }

  .section--split,
  .section--spike {
    grid-template-columns: 1fr;
  }

  .section__rail {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.2em;
    writing-mode: horizontal-tb;
  }

  .section__logo {
    margin: 8px 0 0;
  }

  .hero__scroll {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-mark__text {
    max-width: 14ch;
    white-space: normal;
    line-height: 1;
  }
}
