/* ==========================================================
   Trailhead - palette pulled from the photo:
   pale sky, paddock green, eucalyptus, charred bark, ochre rock.
   Weekday mode swaps the whole thing for a night-shift terminal.
   ========================================================== */

:root,
[data-mode="weekend"] {
  --bg: #f5f1e6;
  --bg-2: #ece6d5;
  --card: #fffdf7;
  --ink: #1e2420;
  --ink-soft: #46504a;
  --muted: #6f786d;
  --sky: #cfdfe6;
  --sky-2: #e8eff0;
  --accent: #b85d24; /* ochre rock */
  --accent-ink: #fffaf0;
  --accent-2: #4f7d2f; /* paddock */
  --gum: #6f8a6a;
  --line: rgba(30, 36, 32, 0.14);
  --shadow: 0 24px 50px -24px rgba(45, 55, 30, 0.45);
  --head: "Fraunces", Georgia, serif;
  --body: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 18px;
  color-scheme: light;
}

[data-mode="weekday"] {
  --bg: #0b1210;
  --bg-2: #101b17;
  --card: #0f1a16;
  --ink: #dcf7e8;
  --ink-soft: #a7c6b6;
  --muted: #6f8f80;
  --sky: #0f1d19;
  --sky-2: #0b1210;
  --accent: #7dffb3; /* phosphor */
  --accent-ink: #062014;
  --accent-2: #ffb454; /* amber */
  --gum: #7dffb3;
  --line: rgba(125, 255, 179, 0.16);
  --shadow:
    0 0 0 1px rgba(125, 255, 179, 0.12), 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --head: "JetBrains Mono", ui-monospace, monospace;
  --radius: 6px;
  color-scheme: dark;
}

/* Show/hide copy per mode */
[data-mode="weekend"] [data-show="weekday"],
[data-mode="weekday"] [data-show="weekend"] {
  display: none !important;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  font-family: var(--head);
  line-height: 1.1;
  margin: 0;
}
button {
  font: inherit;
  color: inherit;
}

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

/* ================= Scroll progress as a trail ================= */
.trail-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 60;
  background: repeating-linear-gradient(
    90deg,
    var(--line) 0 8px,
    transparent 8px 14px
  );
}
.trail-fill {
  height: 100%;
  width: calc(var(--progress, 0) * 100%);
  background: var(--accent);
}
.trail-hiker {
  position: absolute;
  top: -3px;
  left: calc(var(--progress, 0) * 100% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

/* ================= Top bar ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.5s ease;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--head);
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
}
.brand svg {
  width: 26px;
  height: 26px;
  fill: var(--accent-2);
}
.brand svg circle {
  fill: var(--accent);
}
.brand-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav a:hover {
  color: var(--ink);
}
.nav a:hover::after {
  transform: scaleX(1);
}

/* ================= Mode switch ================= */
.mode-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  position: relative;
}
.mode-switch button {
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  white-space: nowrap;
}
.mode-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 14px -6px var(--accent);
}
.mode-switch--lg {
  margin-top: 28px;
}
.mode-switch--lg button {
  padding: 10px 18px;
  font-size: 15px;
}
[data-mode="weekday"] .mode-switch,
[data-mode="weekday"] .mode-switch button {
  border-radius: 4px;
  font-family: var(--mono);
}

.day-note {
  margin: 10px 0 0;
  min-height: 1.5em;
  font-size: 14px;
  color: var(--muted);
}

/* ================= Hero ================= */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding: clamp(40px, 7vw, 96px) clamp(16px, 5vw, 72px) clamp(56px, 8vw, 110px);
  max-width: 1280px;
  margin: 0 auto;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: -80px -50vw 0;
  z-index: -2;
  background: linear-gradient(
    180deg,
    var(--sky) 0%,
    var(--sky-2) 45%,
    var(--bg) 100%
  );
  transition: background 0.5s ease;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/blur.jpg") center 20% / cover no-repeat;
  opacity: 0.28;
  filter: blur(30px) saturate(1.1);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
[data-mode="weekday"] .hero-bg {
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  mask-image: linear-gradient(180deg, #000 50%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent);
}
[data-mode="weekday"] .hero-bg::after {
  opacity: 0;
}

/* the photo's sun, echoed in the page */
.hero-sun {
  position: absolute;
  z-index: -1;
  top: -40px;
  right: 12%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 252, 235, 1) 0%,
    rgba(255, 246, 210, 0.6) 30%,
    transparent 68%
  );
  pointer-events: none;
  animation: shimmer 7s ease-in-out infinite;
}
[data-mode="weekday"] .hero-sun {
  background: radial-gradient(
    circle,
    rgba(125, 255, 179, 0.16),
    transparent 65%
  );
}
@keyframes shimmer {
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}

.eyebrow {
  margin: 0 0 6px;
  font-family: "Caveat", cursive;
  font-size: clamp(28px, 3.4vw, 38px);
  color: var(--accent);
  min-height: 1.3em;
}
[data-mode="weekday"] .eyebrow {
  font-family: var(--mono);
  font-size: 22px;
}
[data-mode="weekday"] .eyebrow::before {
  content: "> ";
  color: var(--muted);
}
.caret {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 3px;
  vertical-align: -0.08em;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-name {
  font-size: clamp(54px, 8.4vw, 112px);
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144;
}
[data-mode="weekday"] .hero-name {
  letter-spacing: -0.06em;
  font-size: clamp(44px, 7vw, 92px);
}
.hero-name .dot {
  color: var(--accent);
}

.role {
  margin: 18px 0 0;
  display: grid;
  gap: 4px;
}
.role-main {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--accent-2);
}
.role-prev {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.role-prev b {
  color: var(--ink-soft);
  font-weight: 600;
}

.lede {
  margin: 20px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-soft);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.3s ease;
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -10px var(--ink);
}
.btn--ghost {
  border: 1.5px solid var(--line);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
[data-mode="weekday"] .btn {
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 600;
}
[data-mode="weekday"] .btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
[data-mode="weekday"] .btn--primary:hover {
  box-shadow: 0 0 24px -4px var(--accent);
}

/* ---------- Postcard ---------- */
.postcard {
  margin: 0;
  justify-self: center;
  width: min(440px, 100%);
  padding: 14px 14px 0;
  background: #fffdf7;
  border-radius: 6px;
  box-shadow:
    var(--shadow),
    0 2px 0 rgba(0, 0, 0, 0.04);
  transform: rotate(2deg);
  transition:
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.5s ease,
    box-shadow 0.5s ease;
}
.postcard:hover {
  transform: rotate(0.5deg) translateY(-4px);
}
[data-mode="weekday"] .postcard {
  background: #08100d;
  border: 1px solid var(--line);
  transform: none;
  padding: 10px 10px 0;
}

.photo {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 3px;
  isolation: isolate;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  transition: filter 0.6s ease;
}
.duotone,
.scanlines,
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  border-radius: 3px;
}
/* Weekday: same photo, but as a green phosphor security cam */
[data-mode="weekday"] .photo img {
  filter: grayscale(1) contrast(1.25) brightness(0.95);
}
.duotone {
  background: #7dffb3;
  mix-blend-mode: multiply;
}
/* lifts the blacks to dark green (sits under the multiply layer) */
.photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #06140e;
  mix-blend-mode: lighten;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  border-radius: 3px;
}
[data-mode="weekday"] .photo::before {
  opacity: 1;
}
.scanlines {
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28) 0 1px,
    transparent 1px 3px
  );
}
[data-mode="weekday"] .duotone,
[data-mode="weekday"] .scanlines,
[data-mode="weekday"] .hud {
  opacity: 1;
}

.hud {
  font-family: var(--mono);
  font-size: 11px;
  color: #c9ffe0;
  letter-spacing: 0.06em;
}
.hud-rec {
  position: absolute;
  top: 12px;
  left: 14px;
  color: #ff6b5b;
  animation: blink 1.4s steps(1) infinite;
}
.hud-cam {
  position: absolute;
  top: 12px;
  right: 14px;
}
.hud-status {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  text-align: center;
  background: rgba(6, 20, 14, 0.6);
  padding: 3px 0;
}
.hud-tl,
.hud-tr,
.hud-bl,
.hud-br {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #c9ffe0;
}
.hud-tl {
  top: 34px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
}
.hud-tr {
  top: 34px;
  right: 10px;
  border-left: 0;
  border-bottom: 0;
}
.hud-bl {
  bottom: 36px;
  left: 10px;
  border-right: 0;
  border-top: 0;
}
.hud-br {
  bottom: 36px;
  right: 10px;
  border-left: 0;
  border-top: 0;
}

/* ---------- Hotspots ---------- */
.spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
.spot::before,
.spot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow:
    0 0 0 3px rgba(184, 93, 36, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}
.spot::after {
  inset: 0;
  background: transparent;
  box-shadow: 0 0 0 2px rgba(255, 253, 247, 0.9);
  animation: ping 2.2s ease-out infinite;
}
.spot:nth-of-type(2n)::after {
  animation-delay: 0.7s;
}
.spot:nth-of-type(3n)::after {
  animation-delay: 1.3s;
}
.spot.is-found::before {
  background: #b85d24;
}
.spot.is-found::after {
  animation: none;
  opacity: 0;
}
.spot:hover::before,
.spot.is-open::before {
  transform: scale(1.25);
}
.spot:hover,
.spot:focus-visible,
.spot.is-open {
  z-index: 10;
}
@keyframes ping {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}
/* weekday: crosshair reticles instead of dots */
[data-mode="weekday"] .spot::before {
  inset: 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: 2px solid #c9ffe0;
  clip-path: polygon(
    0 0,
    35% 0,
    35% 2px,
    2px 2px,
    2px 35%,
    0 35%,
    0 65%,
    2px 65%,
    2px calc(100% - 2px),
    35% calc(100% - 2px),
    35% 100%,
    65% 100%,
    65% calc(100% - 2px),
    calc(100% - 2px) calc(100% - 2px),
    calc(100% - 2px) 65%,
    100% 65%,
    100% 35%,
    calc(100% - 2px) 35%,
    calc(100% - 2px) 2px,
    65% 2px,
    65% 0,
    100% 0,
    100% 100%,
    0 100%
  );
}
[data-mode="weekday"] .spot::after {
  border-radius: 0;
  box-shadow: 0 0 0 1px #c9ffe0;
}
[data-mode="weekday"] .spot.is-found::before {
  border-color: #ffb454;
}

.tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: 220px;
  padding: 10px 13px;
  border-radius: 12px;
  background: #1e2420;
  color: #fffdf7;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 5;
}
.spot:hover .tip,
.spot:focus-visible .tip,
.spot.is-open .tip {
  opacity: 1;
  transform: translate(-50%, 0);
}
.tip-below .tip {
  bottom: auto;
  top: calc(100% + 10px);
}
.tip-left .tip {
  left: -6px;
  transform: translate(0, 6px);
}
.tip-left:hover .tip,
.tip-left:focus-visible .tip,
.tip-left.is-open .tip {
  transform: translate(0, 0);
}
.tip-right .tip {
  left: auto;
  right: -6px;
  transform: translate(0, 6px);
}
.tip-right:hover .tip,
.tip-right:focus-visible .tip,
.tip-right.is-open .tip {
  transform: translate(0, 0);
}
[data-mode="weekday"] .tip {
  background: #06140e;
  color: #c9ffe0;
  border: 1px solid #7dffb3;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.postcard figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 12px;
  padding: 10px 4px 12px;
  color: #3d4540;
}
.cap-weekend {
  font-family: "Caveat", cursive;
  font-size: 22px;
  line-height: 1.1;
}
.cap-weekday {
  font-family: var(--mono);
  font-size: 11px;
  color: #a7c6b6;
}
.spot-count {
  font-family: var(--mono);
  font-size: 11px;
  color: #8a8f86;
  letter-spacing: 0.04em;
}
.spot-count.is-complete {
  color: #b85d24;
  font-weight: 600;
}
[data-mode="weekday"] .spot-count {
  color: #6f8f80;
}
[data-mode="weekday"] .spot-count.is-complete {
  color: #ffb454;
}

/* ================= Ticker ================= */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  padding: 12px 0;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: background-color 0.5s ease;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker var(--ticker-dur, 40s) linear infinite;
}
.ticker-track span {
  padding: 0 28px;
  position: relative;
  white-space: nowrap;
}
.ticker-track span::after {
  content: "▲";
  position: absolute;
  right: -6px;
  font-size: 9px;
  top: 3px;
  color: var(--accent);
}
/* --ticker-shift is one set's width, set by script.js */
@keyframes ticker {
  to {
    transform: translateX(var(--ticker-shift, -50%));
  }
}

/* ================= Sections ================= */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) clamp(16px, 5vw, 64px);
}
.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head h2 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.section-head p {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}
.kanji-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 9px;
  border: 2px solid #c8352b;
  border-radius: 6px;
  color: #c8352b;
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: 15px;
  letter-spacing: 0.15em;
  transform: rotate(-3deg);
}
[data-mode="weekday"] .kanji-tag {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: none;
  border-radius: 2px;
}

/* ---------- Elevation profile ---------- */
.elevation {
  position: relative;
  height: 220px;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.elevation-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.elev-line {
  stroke: var(--accent-2);
  stroke-width: 3;
  stroke-dasharray: 10 7;
  stroke-linecap: round;
}
.js .elevation .elevation-svg {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 2.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.js .elevation.is-in .elevation-svg {
  clip-path: inset(0 0 0 0);
}

.waymark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent-2);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-2);
}
.js .waymark {
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.js .elevation.is-in .waymark {
  opacity: 1;
  transform: scale(1);
}
.js .elevation.is-in .waymark:nth-of-type(1) {
  transition-delay: 0.4s;
}
.js .elevation.is-in .waymark:nth-of-type(2) {
  transition-delay: 0.9s;
}
.js .elevation.is-in .waymark:nth-of-type(3) {
  transition-delay: 1.4s;
}
.js .elevation.is-in .waymark:nth-of-type(4) {
  transition-delay: 1.9s;
}
.waymark--summit {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.flag {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
}
.flag::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--ink);
}

.waypoints {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.waypoint {
  position: relative;
  padding: 22px 20px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}
.waypoint:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
}
.wp-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-2);
}
.wp-place {
  display: block;
  margin: 6px 0 2px;
  font-family: "Caveat", cursive;
  font-size: 22px;
  color: var(--accent);
}
[data-mode="weekday"] .wp-place {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.waypoint h3 {
  font-size: 21px;
  font-weight: 700;
}
.waypoint p {
  margin: 10px 0 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.waypoint--now {
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

/* ---------- Work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}
.terminal {
  position: sticky;
  top: 96px;
  background: #0b1210;
  color: #c9ffe0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(125, 255, 179, 0.18);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #121d19;
  font-family: var(--mono);
  font-size: 12px;
  color: #6f8f80;
}
.term-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff6b5b;
}
.term-bar i:nth-child(2) {
  background: #ffb454;
}
.term-bar i:nth-child(3) {
  background: #7dffb3;
}
.term-bar span {
  margin-left: 8px;
}
.term-body {
  margin: 0;
  padding: 18px 20px 22px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.term-body .p {
  color: #ffb454;
}
.term-body b {
  color: #7dffb3;
}
.term-caret {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  vertical-align: -0.2em;
  background: #7dffb3;
  animation: blink 1s steps(1) infinite;
}

.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.skill {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}
.skill:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.skill-ico {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  color: var(--accent-2);
  font-size: 18px;
  margin-bottom: 10px;
}
.skill h3 {
  font-size: 19px;
  font-weight: 700;
}
.skill p {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
}
.skill--curious {
  border-style: dashed;
  border-color: var(--accent);
}
.skill--curious .skill-ico {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* ---------- View band ---------- */
.view-band {
  position: relative;
  height: clamp(280px, 42vw, 480px);
  overflow: hidden;
  display: grid;
  place-items: end start;
}
.view-band img {
  position: absolute;
  inset: -12% 0 auto 0;
  width: 100%;
  height: 124%;
  object-fit: cover;
  transform: translateY(var(--py, 0px));
  will-change: transform;
}
[data-mode="weekday"] .view-band img {
  filter: grayscale(1) contrast(1.2) brightness(0.5) sepia(1) hue-rotate(90deg)
    saturate(1.6);
}
.view-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(15, 20, 12, 0.7));
}
.view-band-copy {
  position: relative;
  z-index: 1;
  padding: 0 clamp(16px, 5vw, 64px) clamp(24px, 4vw, 48px);
  color: #fffdf7;
  max-width: 760px;
}
.view-band-kicker {
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: 26px;
  color: #ffd9a8;
}
.view-band-quote {
  margin: 4px 0 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

/* ---------- Stamp rally ---------- */
.stamp-card {
  position: relative;
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(255, 255, 255, 0.6),
      transparent 40%
    ),
    #f7efdc;
  color: #2a2620;
  border-radius: 14px;
  padding: clamp(18px, 3vw, 32px);
  box-shadow:
    0 30px 60px -30px rgba(60, 40, 10, 0.45),
    inset 0 0 0 1px rgba(80, 60, 20, 0.12);
}
.stamp-card::before {
  /* perforated edge */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 16px;
  background: radial-gradient(circle, var(--bg) 5px, transparent 5.5px) 0 0 /
    16px 22px repeat-y;
}
.stamp-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 2px dashed rgba(80, 60, 20, 0.25);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sc-title {
  font-weight: 800;
}
.sc-title [lang="ja"] {
  font-family: "Zen Maru Gothic", sans-serif;
  color: #c8352b;
}
.sc-progress {
  color: #8a7a5a;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.5vw, 28px);
}
.stamp-slot {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 14px;
  padding: 8px 6px 12px;
  border: 0;
  background: transparent;
  color: #2a2620;
  text-align: center;
  cursor: pointer;
  border-radius: 12px;
  transition: background-color 0.2s ease;
}
.stamp-slot:hover {
  background: rgba(80, 60, 20, 0.05);
}
.slot-ring,
.stamp {
  grid-area: 1 / 1;
  width: min(150px, 100%);
  aspect-ratio: 1;
}
.slot-ring {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px dashed rgba(80, 60, 20, 0.3);
}
.ghost {
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  color: rgba(80, 60, 20, 0.16);
  transition: color 0.2s ease;
}
.stamp-slot:hover .ghost {
  color: rgba(80, 60, 20, 0.3);
}
.stamp {
  color: var(--stamp-ink);
  opacity: 0;
  transform: scale(1.7) rotate(calc(var(--rot, -8deg) - 20deg));
  pointer-events: none;
}
.stamp-slot.is-stamped .stamp {
  animation: thunk 0.45s cubic-bezier(0.5, 0, 0.7, 1.4) forwards;
}
.stamp-slot.is-stamped .slot-ring {
  border-color: transparent;
}
.stamp-slot.is-stamped .ghost {
  color: transparent;
}
@keyframes thunk {
  0% {
    opacity: 0;
    transform: scale(1.7) rotate(calc(var(--rot, -8deg) - 20deg));
  }
  70% {
    opacity: 0.92;
    transform: scale(0.94) rotate(var(--rot, -8deg));
  }
  100% {
    opacity: 0.88;
    transform: scale(1) rotate(var(--rot, -8deg));
  }
}
.ring-text {
  font-family: var(--mono), "Zen Maru Gothic", sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  fill: currentColor;
}
.kanji {
  font-family: "Zen Maru Gothic", sans-serif;
  font-weight: 700;
  font-size: 40px;
  fill: currentColor;
}
.kanji--2 {
  font-size: 28px;
}
.slot-text {
  font-size: 15px;
  line-height: 1.5;
  color: #5a5040;
}
.slot-text b {
  display: block;
  margin-bottom: 4px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  color: #2a2620;
}
.stamp-slot.is-stamped .slot-text b {
  color: var(--stamp-ink);
}
.stamp-slot.shake {
  animation: shake 0.3s ease;
}
@keyframes shake {
  30% {
    transform: translateY(3px);
  }
  60% {
    transform: translateY(-1px);
  }
}

.rally-done {
  margin: 26px 0 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: #c8352b;
  color: #fff7ea;
  font-weight: 700;
  text-align: center;
  animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.rally-done [lang="ja"] {
  font-family: "Zen Maru Gothic", sans-serif;
  margin-right: 6px;
}
@keyframes pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}

/* sakura */
.petal {
  position: fixed;
  top: -20px;
  z-index: 80;
  width: 12px;
  height: 10px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #ffd6e2, #f59ab5);
  pointer-events: none;
  animation: fall var(--dur, 6s) linear forwards;
}
@keyframes fall {
  to {
    transform: translate(var(--drift, 60px), 105vh) rotate(var(--spin, 540deg));
    opacity: 0.6;
  }
}

/* ---------- Contact ---------- */
.register {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
}
.avatar {
  width: clamp(140px, 20vw, 220px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-2);
  transition: filter 0.5s ease;
}
[data-mode="weekday"] .avatar {
  border-radius: 8px;
  filter: grayscale(1) contrast(1.15) sepia(1) hue-rotate(90deg) saturate(1.4)
    brightness(0.9);
}
.register h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.register p {
  color: var(--ink-soft);
  margin: 12px 0 0;
  max-width: 36em;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 16px 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer p {
  margin: 4px 0;
}
.footer-lnt {
  color: var(--accent-2);
  font-weight: 600;
}
.footer-small {
  font-size: 12.5px;
  font-family: var(--mono);
}

/* ================= Reveal on scroll ================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
.js .waypoints [data-reveal]:nth-child(2),
.js .skills [data-reveal]:nth-child(2) {
  transition-delay: 0.08s;
}
.js .waypoints [data-reveal]:nth-child(3),
.js .skills [data-reveal]:nth-child(3) {
  transition-delay: 0.16s;
}
.js .waypoints [data-reveal]:nth-child(4),
.js .skills [data-reveal]:nth-child(4) {
  transition-delay: 0.24s;
}
.js .skills [data-reveal]:nth-child(5) {
  transition-delay: 0.32s;
}
.js .skills [data-reveal]:nth-child(6) {
  transition-delay: 0.4s;
}

/* ================= Responsive ================= */
@media (max-width: 980px) {
  .waypoints {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
  .terminal {
    position: static;
  }
  .stamps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .nav {
    display: none;
  }
  .mode-switch--sm {
    margin-left: auto;
  }
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .postcard {
    width: min(400px, 100%);
  }
  .elevation {
    height: 160px;
  }
  .flag {
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .ms-label {
    display: none;
  }
  .mode-switch--sm button {
    padding: 6px 10px;
    font-size: 16px;
  }
  .mode-switch--lg {
    display: flex;
    width: 100%;
  }
  .mode-switch--lg button {
    flex: 1;
    padding: 10px 8px;
    font-size: 14px;
  }
  .waypoints {
    grid-template-columns: 1fr;
  }
  .skills {
    grid-template-columns: 1fr;
  }
  .stamps {
    grid-template-columns: 1fr 1fr;
  }
  .slot-text {
    font-size: 14px;
  }
  .register {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .register .hero-ctas {
    justify-content: center;
  }
  .tip {
    max-width: 180px;
    font-size: 13px;
  }
  .elevation {
    height: 130px;
    margin-inline: 4px;
  }
  .waymark {
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    font-size: 12px;
  }
  .flag {
    display: 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;
    transition-delay: 0s !important;
  }
  .ticker-track {
    animation: none;
  }
}
