/* ══════════════════════════════════════════════════════════════════
   SHIFFY · LAUNCHPAD  (apex shiffy.app)
   The fork in the road. One brand, two doors: Jobs and Scheduler.
   Master brand stack — Bricolage wordmark + display,
   Hanken body, Space Mono labels — over the warm Shiffy paper.
   Signature: a split "departures board" where the two paths are the hero.
═══════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* Light theme, congruent with the ShiffyJobs web app (jobs/src/style.css):
     same warm paper + ink ramp + hairline rules. */
  --paper: #fbf7f1;
  --paper-deep: #f4efe6;
  --paper-edge: #ece5d9;
  --surface: #ffffff;

  --ink: #15141b;
  --ink-soft: #4a4538;
  --ink-faint: #6f6859;
  --rule: #b7ad9c;
  --rule-soft: #ece5d9;

  /* Terracotta carries the master brand — the exact marketing-site primary
     (website/globals.css --primary oklch(55% .17 38) = #bf4213). */
  --brand: #bf4213; /* AA on paper (4.91:1) + on white (5.24:1) */
  --brand-tint: rgba(191, 66, 19, 0.08);

  /* Jobs track — coral, straight from the Jobs portal
     (jobs/src/style.css: --accent / --accent-strong). */
  --jobs: #ff5a2c; /* coral — matches the Jobs app wordmark accent */
  --jobs-strong: #c84016; /* AA coral for the CTA fill on light */

  /* Scheduler track — marigold is the distinguishing display hue (e.g. the
     hero underline), terracotta is the AA color for the CTA + Boarding stamp. */
  --sched: #df911a; /* marigold — the Scheduler's distinguishing display hue */
  --sched-strong: #bf4213; /* terracotta — AA CTA/stamp on light */
  --sched-wash: #fdf4e6; /* warm marigold wash in the page background */
  /* Scheduler title word: a marigold deepened until it clears AA 3:1 on the
     white card (true --sched #df911a is only 2.56:1). The Jobs word can use
     --jobs raw because coral already clears 3:1; marigold cannot, hence its
     own token. */
  --sched-word: #c87f0c;

  /* Text/glyph color that sits ON the bright track CTA fills. White reads AA
     on the darker -strong fills (mirrors the Jobs portal's --accent-ink). */
  --cta-ink: #ffffff;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --wordmark: 'Bricolage Grotesque', 'Space Grotesk', sans-serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 18px 50px -22px rgba(29, 26, 23, 0.45), 0 4px 14px -8px rgba(29, 26, 23, 0.18);
  --shadow-lift: 0 34px 70px -28px rgba(194, 69, 29, 0.42), 0 10px 26px -12px rgba(29, 26, 23, 0.22);

  --maxw: 1080px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 18% -10%, var(--brand-tint), transparent 55%),
    radial-gradient(110% 70% at 92% 0%, var(--sched-wash), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(16px, 1.05vw + 13px, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Fine paper grain so the cream never reads as flat AI cream. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

main,
.topbar,
.foot {
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -130%);
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 0 0 12px 12px;
  font: 600 0.85rem/1 var(--body);
  z-index: 50;
  transition: transform 0.18s var(--ease);
}
.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar {
  width: min(var(--maxw), 100% - 2.5rem);
  margin: 0 auto;
  padding: clamp(1.1rem, 3vw, 1.9rem) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 12px;
}
.wordmark__text {
  font-family: var(--wordmark);
  font-weight: 700;
  font-size: clamp(1.5rem, 1vw + 1.25rem, 1.9rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  width: min(var(--maxw), 100% - 2.5rem);
  margin: 0 auto;
  padding: clamp(2.6rem, 7vw, 5rem) 0 clamp(1.8rem, 4vw, 2.8rem);
  max-width: 760px;
}

.hero__title {
  margin: 1.1rem 0 0.9rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.3rem, 5.6vw + 0.6rem, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero__title .hl {
  color: var(--brand);
  position: relative;
  white-space: nowrap;
}
.hero__title .hl::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: 0.04em;
  height: 0.16em;
  background: linear-gradient(90deg, var(--jobs), var(--sched));
  border-radius: 2px;
  opacity: 0.55;
  z-index: -1;
}

.hero__sub {
  font-size: clamp(1.02rem, 0.5vw + 0.95rem, 1.22rem);
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ── Signature: the split departures board ───────────────────────── */
.board {
  width: min(var(--maxw), 100% - 2.5rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
}

.track {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--rule);
  padding: clamp(1.5rem, 2.6vw, 2.4rem);
  min-height: 100%;
  isolation: isolate;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    border-color 0.3s var(--ease);
  transform-style: preserve-3d;
  overflow: hidden;
}
/* Two leaves of one ticket: left rounds left, right rounds right. */
.track--jobs {
  border-radius: 22px 6px 6px 22px;
  border-right: none;
  transform-origin: right center;
}
.track--sched {
  border-radius: 6px 22px 22px 6px;
  border-left: none;
  transform-origin: left center;
}

/* The tear-off seam down the middle, with a perforated "or" token. */
.board__seam {
  position: relative;
  z-index: 3;
  width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board__seam::before {
  content: '';
  position: absolute;
  top: 8%;
  bottom: 8%;
  width: 0;
  border-left: 2.5px dashed var(--rule);
}
.board__or {
  position: relative;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
}

.track__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.track__head {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.track__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 2.4vw + 0.6rem, 2.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}
.track__desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  max-width: 34ch;
}
.track__cta {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.62rem 1.15rem;
  border-radius: 11px;
  color: var(--cta-ink);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: transform 0.24s var(--ease);
}
.track__cta-arrow {
  transition: transform 0.28s var(--ease);
}

/* ── Per-track identity ──────────────────────────────────────────── */
.track--jobs .track__cta {
  background: var(--jobs-strong);
}
/* Title reads "Shiffy" in ink + the product word in its own orange — mirrors
   the Jobs app wordmark (Shiffy + accent "Jobs"). */
.track--jobs .track__title-word {
  color: var(--jobs); /* #ff5a2c — matches the Jobs app wordmark accent */
}

.track--sched .track__cta {
  background: var(--sched-strong);
}
.track--sched .track__title-word {
  /* The AA-deepened marigold (see --sched-word): a golden sibling to the Jobs
     coral, distinctly the "other orange". */
  color: var(--sched-word);
}

/* ── The "door opens" interaction ────────────────────────────────── */
@media (hover: hover) and (min-width: 781px) {
  .track--jobs:hover,
  .track--jobs:focus-visible {
    transform: perspective(1400px) rotateY(2.4deg) translateY(-6px);
  }
  .track--sched:hover,
  .track--sched:focus-visible {
    transform: perspective(1400px) rotateY(-2.4deg) translateY(-6px);
  }
}
.track:hover,
.track:focus-visible {
  z-index: 5;
  border-color: currentColor;
  box-shadow: var(--shadow-lift);
}
.track--jobs:hover,
.track--jobs:focus-visible {
  border-color: var(--jobs-strong);
}
.track--sched:hover,
.track--sched:focus-visible {
  border-color: var(--sched-strong);
}
.track:hover .track__cta-arrow,
.track:focus-visible .track__cta-arrow {
  transform: translateX(4px);
}
.track:active {
  transform: translateY(-2px) scale(0.995);
}

/* Keyboard focus must always be unmistakable. */
.track:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}
.footnote__link:focus-visible,
.foot a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Footnote + footer ───────────────────────────────────────────── */
.footnote {
  width: min(var(--maxw), 100% - 2.5rem);
  margin: clamp(1.4rem, 3vw, 2.2rem) auto 0;
  font-size: 0.95rem;
  color: var(--ink-faint);
}
.footnote__link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  transition: border-color 0.2s var(--ease);
}
.footnote__link:hover {
  border-bottom-color: var(--brand);
}

.foot {
  width: min(var(--maxw), 100% - 2.5rem);
  margin: auto auto 0;
  padding: clamp(2.4rem, 6vw, 4rem) 0 clamp(1.6rem, 3vw, 2.2rem);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule-soft);
  margin-top: clamp(2.4rem, 6vw, 4rem);
}
.foot__copy {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.foot__line {
  font-size: 0.88rem;
  color: var(--ink-faint);
}

/* ── Responsive: stack the board into two full tickets ───────────── */
@media (max-width: 780px) {
  .board {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .track,
  .track--jobs,
  .track--sched {
    border-radius: 20px;
    border: 1.5px solid var(--rule);
    transform: none;
  }
  .board__seam {
    width: auto;
    height: 0;
  }
  .board__seam::before {
    top: auto;
    bottom: auto;
    left: 8%;
    right: 8%;
    width: auto;
    height: 0;
    border-left: none;
    border-top: 2.5px dashed var(--rule);
  }
  .track__desc {
    max-width: none;
  }
}

/* ── Entrance: the board deals itself in (subtle; the tear is the star) ── */
.track {
  /* backwards (not both) so the held end-state never locks the :hover lift. */
  animation: ticket-in 0.55s var(--ease) backwards;
}
.track--sched {
  animation-delay: 0.09s;
}
@keyframes ticket-in {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
}

/* ── Tear & board: the exit choreography (driven by .board--boarding) ───── */
.board-wipe {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--wipe, var(--brand));
  transform: translateX(-101%);
  pointer-events: none;
  will-change: transform;
}
.board-wipe.is-on {
  /* delay lets the tear + stamp read before the screen wipes */
  animation: board-wipe 0.5s cubic-bezier(0.76, 0, 0.24, 1) 0.28s forwards;
}
@keyframes board-wipe {
  to {
    transform: translateX(0);
  }
}

/* The chosen ticket peels up off the perforation and tears free. */
.track--leaving {
  z-index: 8 !important;
  box-shadow: var(--shadow-lift);
  animation: ticket-tear 0.62s var(--ease) forwards;
}
.track--jobs.track--leaving {
  transform-origin: left center;
  --tear-rot: -1.5deg;
}
.track--sched.track--leaving {
  transform-origin: right center;
  --tear-rot: 1.5deg;
}
@keyframes ticket-tear {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  26% {
    transform: translateY(-7px) scale(1.015) rotate(calc(var(--tear-rot) * 0.3));
  }
  100% {
    transform: translateY(-30px) scale(1.05) rotate(var(--tear-rot));
  }
}

/* The other ticket recedes, deferring to the choice. */
.track--receding {
  pointer-events: none;
  animation: ticket-recede 0.46s var(--ease) forwards;
}
@keyframes ticket-recede {
  to {
    opacity: 0.28;
    transform: translateY(12px) scale(0.95);
    filter: saturate(0.55);
  }
}

/* The perforation snaps: dashes fade, the "or" token spins away. */
.board--boarding .board__seam::before {
  animation: seam-snap 0.26s var(--ease) forwards;
}
@keyframes seam-snap {
  to {
    opacity: 0;
  }
}
.board--boarding .board__or {
  animation: or-fly 0.34s var(--ease) forwards;
}
@keyframes or-fly {
  to {
    opacity: 0;
    transform: scale(0.3) rotate(35deg);
  }
}

/* The BOARDING stamp thunks onto the chosen ticket. */
.track__stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.2vw, 2rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.35rem 1rem 0.3rem;
  border: 3.5px solid currentColor;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-13deg) scale(2.5);
}
.track--jobs .track__stamp {
  color: var(--jobs-strong);
}
.track--sched .track__stamp {
  color: var(--sched-strong);
}
.track--leaving .track__stamp {
  animation: stamp-thunk 0.4s var(--ease) 0.14s forwards;
}
@keyframes stamp-thunk {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-13deg) scale(2.5);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-13deg) scale(0.9);
  }
  100% {
    opacity: 0.94;
    transform: translate(-50%, -50%) rotate(-13deg) scale(1);
  }
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .track:hover,
  .track:focus-visible {
    transform: none;
  }
}
