/* ============================================================
   Peter Pierson — style.css
   Palette: basin twilight / bone / trail-marker orange / glacier
   Type: Anton (display) · Space Grotesk (body) · Space Mono (data)
   ============================================================ */

:root {
  --basin:   #0C1410;
  --basin-2: #0f1a15;
  --slate:   #16211B;
  --bone:    #ECE6D6;
  --bone-dim: #A9A99B;
  --dust:    #E8712B;
  --dust-soft: #f0925a;
  --glacier: #83C5B8;
  --stone:   #7C7B6E;
  --hair:    rgba(236, 230, 214, 0.12);
  --hair-strong: rgba(236, 230, 214, 0.22);

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;

  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--bone);
  background:
    radial-gradient(120% 80% at 50% 8%, rgba(232,113,43,0.10), transparent 55%),
    radial-gradient(100% 60% at 50% 100%, rgba(131,197,184,0.06), transparent 60%),
    var(--basin);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); }

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

/* ---------- background canvas + grain ---------- */
#terrain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  display: block;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- shared layout ---------- */
.container {
  width: min(100% - 2.4rem, var(--container));
  margin-inline: auto;
}

.panel {
  position: relative;
  z-index: 2;
  background: var(--basin);
  padding-block: clamp(5.5rem, 12vw, 11rem);
  border-top: 1px solid var(--hair);
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 2.2rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* ---------- header ---------- */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.4rem);
  mix-blend-mode: difference;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--bone);
}
.mark__glyph { color: var(--dust); display: inline-flex; }
.mark__text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.2rem);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.site-nav a { position: relative; padding-block: 0.3rem; }
.site-nav a:not(.site-nav__cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:not(.site-nav__cta):hover::after { transform: scaleX(1); }
.site-nav__cta {
  border: 1px solid var(--bone);
  border-radius: 100px;
  padding: 0.42rem 0.95rem !important;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(1.2rem, 4vw, 2.4rem) clamp(3rem, 7vw, 5rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top, var(--basin) 8%, rgba(12,20,16,0.72) 42%, transparent 100%);
}

.hero__inner { position: relative; max-width: 1180px; margin-inline: auto; width: 100%; }

.hero__eyebrow {
  font-size: clamp(0.68rem, 1.6vw, 0.82rem);
  letter-spacing: 0.16em;
  color: var(--glacier);
  margin-bottom: 1.4rem;
  text-transform: uppercase;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(4rem, 18vw, 16rem);
  line-height: 0.82;
  letter-spacing: 0.005em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span {
  display: block;
  transform: translateY(110%);
  background: linear-gradient(100deg,
    var(--bone) 0 42%, var(--dust-soft) 50%, var(--bone) 58% 100%);
  background-size: 280% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  animation: rise 1s var(--ease) forwards, glint 7s ease-in-out 1.2s infinite;
}
.hero__title .line:nth-child(2) > span { animation-delay: 0.12s, 1.55s; }

@keyframes glint {
  0%, 55% { background-position: 120% 0; }
  85%, 100% { background-position: -60% 0; }
}

.hero__sub {
  margin-top: 1.8rem;
  max-width: 34ch;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--bone);
  opacity: 0;
  animation: fade 0.9s ease 0.5s forwards;
}

.hero__scroll {
  position: absolute;
  right: clamp(1.2rem, 4vw, 2.4rem);
  bottom: clamp(3rem, 7vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.hero__scroll-line {
  width: 1px; height: 46px;
  background: linear-gradient(var(--dust), transparent);
  animation: drop 1.8s ease-in-out infinite;
}

@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  40%  { transform: scaleY(1); transform-origin: top; }
  60%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- intro ---------- */
.intro__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.intro__body { max-width: 46ch; display: grid; gap: 1.2rem; }
.intro__body p { font-size: clamp(1.02rem, 1.5vw, 1.22rem); color: var(--bone-dim); }
.intro__body p:nth-child(2) { color: var(--dust-soft); font-family: var(--font-mono); font-size: 1rem; }

/* ---------- work / log ---------- */
.work__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.work__head .eyebrow { margin-bottom: 1rem; }

.log { list-style: none; }
.log__row {
  display: grid;
  grid-template-columns: 5rem 1fr auto 2rem;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0.5rem;
  border-top: 1px solid var(--hair);
  transition: background 0.4s var(--ease), padding-left 0.4s var(--ease);
}
.log li:last-child { border-bottom: 1px solid var(--hair); }
.log__row:hover {
  background: var(--slate);
  padding-left: 1.4rem;
}
.log__year { font-size: 0.9rem; color: var(--stone); align-self: start; padding-top: 0.35rem; }
.log__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.log__desc { margin-top: 0.6rem; color: var(--bone-dim); max-width: 52ch; font-size: 1rem; }
.log__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  list-style: none;
}
.log__stack li {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--glacier);
  border: 1px solid var(--hair-strong);
  border-radius: 100px;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
}
.log__arrow {
  font-size: 1.5rem;
  color: var(--dust);
  transform: translate(-6px, 6px);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.log__row:hover .log__arrow { transform: translate(0,0); opacity: 1; }

/* ---------- racing ---------- */
.racing { overflow: hidden; }
.racing__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.racing__copy p {
  margin-top: 1.4rem;
  color: var(--bone-dim);
  max-width: 44ch;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 2.8rem;
}
.stat { display: flex; flex-direction: column; gap: 0.4rem; }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  color: var(--bone);
}
.stat__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); }

.profile {
  border: 1px solid var(--hair);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(131,197,184,0.04), transparent);
  padding: 1.4rem;
}
.profile svg { width: 100%; height: auto; display: block; }
.profile__line {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}
.reveal.is-in .profile__line { animation: draw 2.4s var(--ease) 0.2s forwards; }
.profile__area { opacity: 0; }
.reveal.is-in .profile__area { animation: fade 1.6s ease 1.4s forwards; }
.profile__peak { opacity: 0; }
.reveal.is-in .profile__peak { animation: fade 0.4s ease 2.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.profile figcaption {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--stone);
  flex-wrap: wrap;
}
.profile__summit { color: var(--dust); }

/* ---------- contact ---------- */
.contact__big {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  margin-bottom: 1.6rem;
}
.contact__lead { color: var(--bone-dim); max-width: 40ch; font-size: clamp(1.02rem, 1.5vw, 1.2rem); }

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.6rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.95rem 1.6rem;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}
.btn--primary { background: var(--dust); color: var(--basin); font-weight: 700; }
.btn--primary:hover { transform: translateY(-3px); background: var(--dust-soft); }
.btn--ghost { border-color: var(--hair-strong); color: var(--bone); }
.btn--ghost:hover { border-color: var(--bone); transform: translateY(-3px); }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  margin-top: 3rem;
  list-style: none;
  font-size: 0.85rem;
}
.social a { color: var(--bone-dim); transition: color 0.25s ease; }
.social a:hover { color: var(--glacier); }

/* ---------- footer ---------- */
.site-foot {
  position: relative;
  z-index: 2;
  background: var(--basin);
  border-top: 1px solid var(--hair);
  padding-block: 2rem;
}
.site-foot__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--stone);
}

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.log__row.reveal { transition-delay: 0.05s; }

/* ---------- survey HUD ---------- */
.hud {
  position: fixed;
  left: clamp(1.2rem, 4vw, 2.4rem);
  bottom: clamp(1.4rem, 4vw, 2.2rem);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--stone);
  pointer-events: none;
  mix-blend-mode: difference;
}
.hud__rose { color: var(--glacier); }
.hud__needle { transform-box: fill-box; transform-origin: center; transition: transform 0.3s linear; }
.hud__lines { display: flex; flex-direction: column; gap: 0.25rem; }
.hud__coord { color: var(--bone); }
.hud__sec { color: var(--dust); letter-spacing: 0.16em; text-transform: uppercase; }
.hud__bar { width: 116px; height: 2px; background: var(--hair-strong); overflow: hidden; }
.hud__fill { display: block; height: 100%; width: 0%; background: var(--dust); transition: width 0.2s linear; }
.hud__pct { color: var(--stone); }

/* ---------- TSA markers ---------- */
.work__note {
  margin-top: 1.1rem;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--stone);
}
.work__note::first-letter { color: var(--dust); }
.log__tsa {
  display: inline-block;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--dust);
  border: 1px solid rgba(232, 113, 43, 0.45);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
  margin-left: 0.7rem;
  transform: translateY(-0.18em);
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .intro__grid,
  .racing__grid { grid-template-columns: 1fr; }
  .racing__grid { gap: 3rem; }
  .log__row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "year arrow"
      "main main"
      "stack stack";
    row-gap: 0.9rem;
  }
  .log__year { grid-area: year; padding-top: 0; }
  .log__main { grid-area: main; }
  .log__stack { grid-area: stack; justify-content: flex-start; }
  .log__arrow { grid-area: arrow; justify-self: end; opacity: 1; transform: none; }
  .log__row:hover { padding-left: 0.5rem; }
  .site-nav a:not(.site-nav__cta) { display: none; }
  .hud { display: none; }
}

@media (max-width: 480px) {
  .stats { gap: 1.6rem; }
  .hero__scroll { display: none; }
}

/* ---------- accessibility ---------- */
:focus-visible { outline: 2px solid var(--dust); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero__title .line > span { transform: none; }
  .hero__sub { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
  .profile__line { stroke-dashoffset: 0; }
  .profile__area, .profile__peak { opacity: 1; }
}
