/* calebvickers.com — editorial dossier. Tokens first (DESIGN.md §0.3). */

:root {
  /* type */
  --font-display: "Clash Display", "Switzer", sans-serif;
  --font-text: "Switzer", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* palette — warm paper + warm ink + signal green (OKLCH-tuned) */
  --paper: #efe9dc;
  --paper-2: #e7dfcd;
  --paper-3: #ded3bc;
  --ink: #191611;
  --ink-2: #4e4736;
  --ink-3: #6f6852;
  --line: rgb(25 22 17 / 0.16);
  --line-soft: rgb(25 22 17 / 0.09);
  --live: #29a96e;
  --live-deep: #1a6b46;
  --down: #8f5a12;

  /* layered, tinted shadows (never one flat blur) */
  --shadow-sm: 0 1px 2px -1px rgb(40 32 16 / 0.10), 0 1px 1px rgb(40 32 16 / 0.05);
  --shadow-md: 0 2px 4px -2px rgb(40 32 16 / 0.09), 0 6px 12px -3px rgb(40 32 16 / 0.09),
               0 12px 24px -6px rgb(40 32 16 / 0.07);
  --shadow-lg: 0 4px 8px -4px rgb(40 32 16 / 0.10), 0 14px 28px -8px rgb(40 32 16 / 0.11),
               0 28px 56px -14px rgb(40 32 16 / 0.13);

  /* motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-micro: 180ms;
  --dur-enter: 640ms;

  /* rhythm */
  --wrap: 1180px;
  --pad: clamp(20px, 5vw, 64px);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(41 169 110 / 0.05), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgb(179 112 31 / 0.04), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.55;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

a { color: inherit; }

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

/* film grain — kills flatness */
.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ masthead ============ */
.masthead {
  display: flex; justify-content: space-between; align-items: center;
  padding-block: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.brand { text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; }
/* ^ the one dot that stays: it's the wordmark accent, not a status light */
.masthead nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.masthead nav a {
  text-decoration: none; color: var(--ink-2); position: relative;
  transition: color var(--dur-micro) var(--ease-out-quart);
}
.masthead nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 240ms var(--ease-out-expo);
}
.masthead nav a:hover { color: var(--ink); }
.masthead nav a:hover::after { transform: scaleX(1); }

.pulse-chip {
  display: none; /* without JS there's no pulse — don't show a stuck "checking…" */
  align-items: center; gap: 7px;
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--ink-2); background: rgb(255 255 255 / 0.28);
}
.js .pulse-chip { display: inline-flex; }

/* live status is text-only — no dots (Caleb's call) */
.pulse-chip.is-ok #pulse-chip-text { color: var(--live-deep); }
.pulse-chip.is-down #pulse-chip-text { color: var(--down); }

/* ============ hero ============ */
.hero { padding-block: clamp(56px, 10vh, 120px) clamp(48px, 8vh, 96px); }

.kicker { color: var(--live-deep); margin-bottom: clamp(18px, 3vh, 32px); }

.name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 1rem + 13.5vw, 10.5rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.name .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.name .line-in { display: inline-block; }
.name .line-2 { margin-left: clamp(0.6em, 8vw, 1.2em); } /* broken grid on purpose */

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(240px, 4fr);
  gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(36px, 6vh, 64px);
  align-items: start;
}
.lede { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem); line-height: 1.45; max-width: 34ch; color: var(--ink); }
.lede a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

.meta { border-left: 1px solid var(--line); padding-left: clamp(16px, 2vw, 28px); display: grid; gap: 14px; }
.meta div { display: grid; gap: 3px; }
.meta dt { color: var(--ink-3); }
.meta dd { color: var(--ink); letter-spacing: 0.04em; display: flex; align-items: center; gap: 7px; }
.meta dd a { text-decoration: none; }
.meta dd a:hover { text-decoration: underline; text-underline-offset: 3px; }

.cta-row { display: flex; align-items: center; gap: 26px; margin-top: clamp(30px, 5vh, 52px); flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  font-weight: 500; text-decoration: none;
  padding: 15px 26px; border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: transform 260ms var(--ease-out-expo), box-shadow 260ms var(--ease-out-expo);
  will-change: transform;
}
.btn:hover { box-shadow: var(--shadow-lg); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.ghost-link {
  text-decoration: none; font-weight: 500; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color var(--dur-micro) var(--ease-out-quart), border-color var(--dur-micro) var(--ease-out-quart);
}
.ghost-link:hover { color: var(--ink); border-color: var(--ink); }
.ghost-link span { display: inline-block; transition: transform 240ms var(--ease-out-expo); }
.ghost-link:hover span { transform: translate(3px, -3px); }

/* ============ sections ============ */
.sec { position: relative; padding-block: clamp(64px, 12vh, 140px); border-top: 1px solid var(--line-soft); }
.sec::before {
  content: attr(data-num);
  position: absolute; top: clamp(24px, 5vh, 56px); right: var(--pad);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(5rem, 14vw, 12rem); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgb(25 22 17 / 0.10);
  pointer-events: none; user-select: none;
}
.sec-head { max-width: 56ch; margin-bottom: clamp(36px, 6vh, 64px); }
.sec-head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 3.4vw, 3.6rem);
  letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance;
}
.sec-head h2 em { font-style: normal; color: var(--live-deep); }
.note { margin-top: 14px; color: var(--ink-2); max-width: 46ch; }

/* ============ 01 fleet ============ */
.fleet { list-style: none; border-top: 1px solid var(--line); }
.fleet li { border-bottom: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto 28px;
  gap: clamp(14px, 3vw, 36px);
  align-items: center;
  padding: clamp(20px, 3vh, 30px) clamp(8px, 1.5vw, 20px);
  text-decoration: none;
  border-radius: 10px;
  transition: background 240ms var(--ease-out-quart), transform 320ms var(--ease-out-expo),
              box-shadow 320ms var(--ease-out-expo);
}
.row:hover {
  background: rgb(255 255 255 / 0.32);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 0.68rem; }
.status.is-ok { color: var(--live-deep); }
.status.is-down { color: var(--down); }
.row h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.25rem, 1rem + 1.2vw, 1.8rem); letter-spacing: -0.015em; }
.row p { color: var(--ink-2); margin-top: 4px; max-width: 52ch; font-size: 0.95em; }
.tags { color: var(--ink-3); white-space: nowrap; }
.arrow { color: var(--ink-3); font-size: 1.1rem; transition: transform 240ms var(--ease-out-expo), color var(--dur-micro); }
.row:hover .arrow { transform: translate(4px, -4px); color: var(--ink); }

/* ============ 02 cards ============ */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.5vw, 28px); }
.card {
  background: rgb(255 255 255 / 0.34);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow-sm);
  transition: transform 340ms var(--ease-out-expo), box-shadow 340ms var(--ease-out-expo);
}
.card:nth-child(2) { transform: translateY(clamp(8px, 2vw, 22px)); } /* staggered baseline */
.card:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: var(--shadow-lg); }
.card:nth-child(2):hover { transform: translateY(calc(clamp(8px, 2vw, 22px) - 4px)) rotate(0.4deg); }
.card-tag { color: var(--live-deep); margin-bottom: 14px; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 0.95em; }

/* ============ 03 hood ============ */
.hood-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(240px, 4fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.cap-list { list-style: none; display: grid; gap: clamp(22px, 3.5vh, 34px); }
.cap-list li { display: flex; gap: 18px; align-items: flex-start; }
.cap-list svg {
  width: 20px; height: 20px; flex: none; margin-top: 4px;
  fill: none; stroke: var(--live-deep); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.cap-list h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin-bottom: 4px; }
.cap-list p { color: var(--ink-2); font-size: 0.95em; max-width: 52ch; }
.stack {
  position: sticky; top: 32px;
  border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(20px, 2.5vw, 30px);
  background: rgb(255 255 255 / 0.32);
  box-shadow: var(--shadow-sm);
}
.stack-title { color: var(--ink-3); margin-bottom: 16px; font-weight: 500; }
.stack ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.stack li {
  border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 12px; color: var(--ink-2); background: var(--paper);
}

/* ============ 04 timeline ============ */
.tl { list-style: none; border-left: 1px solid var(--line); margin-left: 6px; }
.tl li { position: relative; padding: 0 0 clamp(30px, 5vh, 44px) clamp(24px, 4vw, 44px); }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
  content: ""; position: absolute; left: -5px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink-3);
}
.tl-now::before { background: var(--live); border-color: var(--live-deep); }
.tl-when { display: block; color: var(--ink-3); margin-bottom: 6px; }
.tl-body h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem); letter-spacing: -0.01em; }
.tl-body p { color: var(--ink-2); margin-top: 5px; max-width: 60ch; font-size: 0.97em; }

/* ============ 05 contact ============ */
.sec-contact { padding-bottom: clamp(48px, 8vh, 90px); }
.big-mail {
  display: block; text-decoration: none;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 0.6rem + 6.4vw, 5.4rem);
  letter-spacing: -0.03em; line-height: 1.05;
  overflow-wrap: anywhere;
  padding-block: 10px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat; background-size: 0% 3px; background-position: 0 96%;
  transition: background-size 460ms var(--ease-out-expo), color 260ms var(--ease-out-quart);
}
.big-mail:hover { background-size: 100% 3px; }
.contact-sub { margin-top: 22px; color: var(--ink-2); }
.contact-sub a { text-underline-offset: 3px; }

/* ============ footer ============ */
footer { border-top: 1px solid var(--line-soft); padding-block: 32px 44px; color: var(--ink-3); display: grid; gap: 8px; }
.foot-pulse { color: var(--ink-2); }
.colophon { color: var(--ink-3); }

/* ============ reveals ============ */
/* hidden states only exist when JS is running (html.js set inline in <head>) */
.js .reveal-load { opacity: 0; transform: translateY(22px); animation: rise var(--dur-enter) var(--ease-out-expo) forwards; animation-delay: calc(var(--d) * 110ms); }
.js .name .line-in { transform: translateY(110%); animation-name: rise-full; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@keyframes rise-full { to { opacity: 1; transform: translateY(0); } }

.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease-out-expo), transform 700ms var(--ease-out-expo); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].in { opacity: 1; transform: translateY(0); }

/* ============ responsive ============ */
@media (max-width: 900px) {
  .hero-grid, .hood-grid { grid-template-columns: 1fr; }
  .meta { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 20px; grid-template-columns: 1fr 1fr; }
  .stack { position: static; }
  .cards { grid-template-columns: 1fr; }
  .card:nth-child(2) { transform: none; }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "status status" "body body" "tags arrow"; row-gap: 10px; }
  .status { grid-area: status; }
  .row-body { grid-area: body; }
  .tags { grid-area: tags; }
  .arrow { grid-area: arrow; justify-self: end; }
}
@media (max-width: 560px) {
  .masthead nav a:not(:last-of-type) { display: none; }
  .sec::before { font-size: 4.6rem; }
}

/* ============ print — it is a résumé, after all ============ */
@media print {
  .grain::after, .pulse-chip, .cta-row, .arrow { display: none; }
  .js .reveal-load, .js [data-reveal], .js .name .line-in { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .sec { padding-block: 28px; }
  body { background: #fff; }
}

/* ============ reduced motion — non-negotiable ============ */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .reveal-load, [data-reveal] { opacity: 1; transform: none; }
  .name .line-in { transform: none; }
}
