/* ============================================================
   CHAD MALLAM — The Work · career page styles
   Rides on styles.css tokens (dark forced via data-theme). The
   chapters grow more technological as the timeline advances:
   paper → cels → broadcast → film → devices → web → gallery →
   blueprint → primetime → orbit → lab → terminal.
   ============================================================ */

/* ---------- gate ---------- */
html.cm-locked { overflow: hidden; }
html.cm-locked body { overflow: hidden; height: 100vh; }
html.cm-unlocked .gate { display: none; }

.gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--sky);
  transition: opacity .8s var(--ease), visibility .8s;
}
.gate.is-open { opacity: 0; visibility: hidden; }
.gate__stars { position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(238,242,250,.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 28% 64%, rgba(182,205,242,.8), transparent 60%),
    radial-gradient(1px 1px at 44% 12%, rgba(238,242,250,.7), transparent 60%),
    radial-gradient(2px 2px at 61% 38%, rgba(236,214,166,.85), transparent 60%),
    radial-gradient(1px 1px at 72% 70%, rgba(238,242,250,.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 84% 18%, rgba(182,205,242,.85), transparent 60%),
    radial-gradient(1px 1px at 93% 52%, rgba(238,242,250,.75), transparent 60%),
    radial-gradient(1px 1px at 8% 82%, rgba(223,158,121,.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 52% 86%, rgba(238,242,250,.65), transparent 60%);
}
.gate__card {
  position: relative; width: min(440px, 100%); text-align: center;
  padding: 44px 36px 36px; border-radius: 26px;
  background: rgba(8, 13, 24, .78);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px var(--panel-ring), 0 30px 80px -30px rgba(0,0,0,.8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.gate__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 15px;
  border: 1px solid rgba(214,186,120,.5); color: var(--accent);
  font: 500 1.05rem/1 var(--mono); letter-spacing: .04em;
  box-shadow: 0 0 26px -8px var(--accent-glow);
}
.gate__title { margin-top: 18px; font-size: 2rem; font-weight: 500; letter-spacing: -.03em; }
.gate__sub { margin-top: 12px; font-size: .92rem; line-height: 1.65; color: var(--fg-2); }
.gate__form { display: flex; gap: 10px; margin-top: 26px; }
.gate__input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--fg);
  font: 400 .95rem/1 var(--sans); outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.gate__input::placeholder { color: var(--fg-4); }
.gate__input:focus { border-color: rgba(214,186,120,.55); box-shadow: 0 0 18px -8px var(--accent-glow); }
.gate__btn {
  height: 48px; padding: 0 22px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--btn-solid-bg); color: var(--btn-solid-fg);
  font: 500 .92rem/1 var(--sans);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.gate__btn:hover { background: var(--btn-solid-bg-hover); transform: translateY(-1px); }
.gate__btn[disabled] { opacity: .6; cursor: default; transform: none; }
.gate__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gate__err { min-height: 1.2em; margin-top: 12px; font: 500 .8rem/1.4 var(--mono); color: #e08d8d; }
.gate__fine { margin-top: 14px; font-size: .74rem; line-height: 1.7; color: var(--fg-3); }
@media (max-width: 480px) {
  .gate__form { flex-direction: column; }
  .gate__btn { width: 100%; }
}

/* ---------- chapter rail ---------- */
.rail {
  position: fixed; left: 22px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 14px;
  opacity: 0; transition: opacity .6s var(--ease);
}
.rail.is-on { opacity: 1; }
.rail a { position: relative; display: block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-4); transition: background .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease); }
.rail a:hover { background: var(--fg-2); }
.rail a.is-active { background: var(--accent); box-shadow: 0 0 12px -2px var(--accent-glow); transform: scale(1.25); }
.rail a span {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%) translateX(-6px);
  white-space: nowrap; padding: 5px 11px; border-radius: 9px;
  background: var(--sheet-bg); border: 1px solid var(--line);
  font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.rail a:hover span { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 1180px) { .rail { display: none; } }

/* ---------- hero ---------- */
.hero--career .hero__arc {
  margin-top: 34px; font: 500 10.5px/1.9 var(--mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3);
}
.hero--career .hero__arc { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- era sections ---------- */
.era { position: relative; z-index: 2; padding: 110px 0 90px; background: var(--bg); }
.era__head { max-width: 780px; }
.era__head .h2 { margin-top: 18px; }
.era__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px; align-items: center; margin-top: 44px;
}
.era__grid--flip .era__copy { order: 2; }
.era__grid--flip .era__media { order: 1; }
.era__grid--under { margin-top: 40px; align-items: start; }
.era__copy { max-width: 560px; }
.era__p { margin-top: 18px; font-size: 1.02rem; line-height: 1.75; color: var(--fg-2); transition: opacity .3s linear; }
.era__p:first-child { margin-top: 0; }
.era__p b { color: var(--fg); font-weight: 500; }
.era__p em { color: var(--fg); font-style: italic; }
.era__p--center { max-width: 620px; margin: 44px auto 0; text-align: center; }
.era__lede { max-width: 700px; margin-top: 20px; font-size: 1.05rem; line-height: 1.7; color: var(--fg-2); }
@media (max-width: 900px) {
  .era { padding: 70px 0 56px; }
  .era__grid { grid-template-columns: 1fr; gap: 34px; }
  .era__grid--flip .era__copy { order: 1; }
  .era__grid--flip .era__media { order: 2; }
}

/* ---------- plates (media slots) ---------- */
.plate {
  position: relative; margin: 0; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--panel-ring), 0 24px 60px -34px rgba(0,0,0,.8);
}
.plate__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px 18px; font: 400 .72rem/1.6 var(--mono); color: var(--fg-3);
  background: linear-gradient(to top, rgba(5,8,17,.92), rgba(5,8,17,0));
}
.plate__slot { color: var(--accent); opacity: .85; }

/* 01 · paper */
.plate--paper { background: #efe8d8; border-color: rgba(60,50,30,.25); }
.plate--paper .plate__paper { padding: 26px 28px 58px; min-height: 320px;
  background:
    radial-gradient(rgba(60,50,30,.06) 1px, transparent 1.5px);
  background-size: 7px 7px; color: #2c2618; }
.plate__masthead { font: 600 1.35rem/1 var(--sans); letter-spacing: .22em; text-align: center; color: #241f12; }
.plate__rule { height: 2px; margin: 12px 0 18px; background: #241f12; opacity: .75; }
.plate__cartoon { display: block; width: 100%; height: auto; }
.plate__cartoon .ink { stroke: #241f12; stroke-width: 2.4; stroke-linecap: round; }
.plate__cartoon .ink--b { stroke-width: 1.4; opacity: .5; }
.plate__caption-line { margin-top: 8px; text-align: center; font: 400 .8rem/1 var(--mono); color: #4a4130; }
.plate--paper .plate__cap { background: linear-gradient(to top, rgba(36,31,18,.88), rgba(36,31,18,0)); color: #d8cfb8; }
.plate--paper .plate__slot { color: #8f6d28; }

/* 01→02 · ink line transition */
.inkline { position: relative; z-index: 2; height: 120px; margin: 40px 0 -80px; pointer-events: none; }
.inkline svg { width: 100%; height: 100%; display: block; }
.inkline__path {
  stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .55;
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.inkline.is-drawn .inkline__path { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s var(--ease); }

/* 02 · animation cel */
.plate--cel { background: #0b101d; }
.plate__punch { display: flex; justify-content: center; gap: 60px; padding: 16px 0 0; }
.plate__punch i { width: 26px; height: 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-2); }
.plate__cel { position: relative; margin: 16px 22px 54px; min-height: 260px; border-radius: 14px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(90% 90% at 30% 20%, rgba(120,170,210,.16), transparent 60%),
    radial-gradient(80% 80% at 75% 75%, rgba(214,186,120,.10), transparent 55%),
    linear-gradient(180deg, #10192e, #0a0f1c); }
.plate__frame-tag { position: absolute; top: 12px; left: 14px; font: 500 10px/1 var(--mono); letter-spacing: .12em; color: var(--fg-3); }
.plate__bubbles { position: absolute; inset: 0; }
.plate__bubbles i { position: absolute; border-radius: 50%; border: 1px solid rgba(150,200,235,.4); }
.plate__bubbles i:nth-child(1) { width: 10px; height: 10px; left: 24%; bottom: 18%; }
.plate__bubbles i:nth-child(2) { width: 16px; height: 16px; left: 30%; bottom: 34%; }
.plate__bubbles i:nth-child(3) { width: 8px; height: 8px; left: 27%; bottom: 52%; }
.plate__bubbles i:nth-child(4) { width: 22px; height: 22px; left: 36%; bottom: 64%; opacity: .7; }
.plate__bubbles i:nth-child(5) { width: 12px; height: 12px; left: 44%; bottom: 78%; opacity: .5; }

/* 03 · broadcast */
.plate--broadcast .reel__placeholder { min-height: 300px; }
.plate__scan { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(190,205,228,.06) 0 1px, transparent 1px 4px); }
.reel__live { position: absolute; top: 16px; left: 18px; z-index: 2;
  font: 500 10.5px/1 var(--mono); letter-spacing: .14em; color: #e08d8d; }

/* 04 · film */
.reel--wide { margin-top: 40px; }
.reel--wide .reel__placeholder { min-height: clamp(280px, 42vw, 520px); }
.plate--film { border-image: none; }
.plate--film::before, .plate--film::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 22px; z-index: 2; pointer-events: none;
  background-image: radial-gradient(4px 6px at 50% 50%, var(--bg) 60%, transparent 61%);
  background-size: 22px 26px; background-repeat: repeat-y;
  border-color: var(--line);
}
.plate--film::before { left: 0; border-right: 1px solid var(--line); background-color: #0a0f1a; }
.plate--film::after { right: 0; border-left: 1px solid var(--line); background-color: #0a0f1a; }
.era__aside { align-self: center; }
.laurel { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 18px;
  border: 1px solid rgba(214,186,120,.35); background: var(--accent-soft); }
.laurel__mark { font-size: 1.5rem; color: var(--accent); }
.laurel b { display: block; font-weight: 500; font-size: .95rem; }
.laurel small { display: block; margin-top: 3px; font-size: .78rem; color: var(--fg-3); }

/* 05 · device */
.plate--device { padding: 34px 26px 58px; }
.phone { width: 150px; margin: 0 auto; border-radius: 22px; padding: 12px 10px 10px;
  background: linear-gradient(180deg, #1a2338, #0d1424); border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.9); }
.phone__screen { position: relative; height: 180px; border-radius: 10px; overflow: hidden; padding: 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(64,98,143,.55), transparent 70%),
    linear-gradient(180deg, #0e1730, #050811); }
.phone__brand { font: 600 .78rem/1 var(--sans); letter-spacing: .16em; color: var(--fg); }
.phone__rows { margin-top: 14px; display: grid; gap: 8px; }
.phone__rows i { height: 22px; border-radius: 5px; background: rgba(190,205,228,.10); }
.phone__rows i:nth-child(1) { background: rgba(214,186,120,.28); }
.phone__tick { position: absolute; bottom: 10px; left: 12px; font: 500 8.5px/1 var(--mono); letter-spacing: .12em; color: var(--accent); }
.phone__keys { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.phone__keys i { width: 26px; height: 5px; border-radius: 3px; background: rgba(190,205,228,.18); }
.plate__nets { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.plate__nets span { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2);
  font: 500 9.5px/1 var(--mono); letter-spacing: .14em; color: var(--fg-2); }

/* 06 · digital / browser */
.plate--digital .reel__placeholder { padding: 20px 20px 52px; }
.browser { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #0b111f; }
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: #0e1526; }
.browser__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(190,205,228,.22); }
.browser__bar span { margin-left: 10px; flex: 1; padding: 5px 12px; border-radius: 7px; background: var(--bg);
  font: 400 10.5px/1 var(--mono); color: var(--fg-3); }
.browser__body { position: relative; min-height: 210px;
  background:
    radial-gradient(90% 100% at 50% 100%, rgba(64,98,143,.35), transparent 70%),
    linear-gradient(180deg, #0c1322, #080d18); }
.marquee { margin-top: 18px; overflow: hidden; white-space: nowrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 0; }
.marquee span { display: inline-block; padding-left: 100%; animation: cm-marquee 28s linear infinite;
  font: 500 10.5px/1 var(--mono); letter-spacing: .18em; color: var(--fg-3); }
.marquee--gold { margin-top: 26px; border-color: rgba(214,186,120,.25); }
.marquee--gold span { color: var(--accent); opacity: .8; }
@keyframes cm-marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee span { animation: none; padding-left: 0; } }

/* 07 · gallery */
.plate--gallery { padding: 20px 20px 56px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery i { display: flex; align-items: flex-end; padding: 12px; aspect-ratio: 4/3; border-radius: 12px;
  border: 1px solid var(--line); font-style: normal;
  background: linear-gradient(160deg, #13203a, #0a101d); }
.gallery i:nth-child(1) { background: linear-gradient(160deg, #2a2410, #0f0d06); }
.gallery i:nth-child(2) { background: linear-gradient(160deg, #26142e, #0e0813); }
.gallery i:nth-child(4) { background: linear-gradient(160deg, #0e2a2a, #071313); }
.gallery i:nth-child(5) { background: linear-gradient(160deg, #12203c, #070d1a); }
.gallery i:nth-child(6) { background: linear-gradient(160deg, #301b12, #120a06); }
.gallery span { font: 500 9px/1.5 var(--mono); letter-spacing: .12em; color: var(--fg-2); }

/* 08 · blueprint */
.plate--garage { background: #081020; }
.blueprint { position: relative; margin: 20px; margin-bottom: 56px; min-height: 260px; border-radius: 14px;
  border: 1px solid rgba(120,160,220,.28); padding: 18px;
  background:
    linear-gradient(rgba(120,160,220,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,160,220,.07) 1px, transparent 1px),
    linear-gradient(180deg, #0a1428, #071022);
  background-size: 22px 22px, 22px 22px, 100% 100%; }
.blueprint__label { font: 500 10px/1 var(--mono); letter-spacing: .14em; color: rgba(160,195,245,.75); }
.blueprint svg { display: block; width: 100%; height: auto; margin-top: 10px; }
.blueprint .bp { fill: none; stroke: rgba(160,195,245,.6); stroke-width: 1.4; stroke-dasharray: 5 4; }
.blueprint .bp--dot { fill: var(--accent); stroke: none; }

/* 09 · primetime */
.plate--primetime .reel__placeholder {
  background:
    radial-gradient(120% 90% at 50% 100%, rgba(214,186,120,.14), transparent 60%),
    radial-gradient(100% 100% at 50% 0%, rgba(14,23,48,.9), transparent 100%),
    #070b14; }

/* 10 · orbit */
.plate--orbit .reel__placeholder { min-height: 320px; }
.orbit { position: absolute; inset: 0; overflow: hidden; }
.orbit__horizon { position: absolute; left: -20%; right: -20%; bottom: -46%; height: 70%;
  border-radius: 50% 50% 0 0;
  background: radial-gradient(60% 100% at 50% 0%, rgba(150,190,240,.35), rgba(14,23,48,.9) 55%, #050811 100%);
  box-shadow: 0 -1px 24px rgba(150,190,240,.35); }
.orbit__bar { position: absolute; left: 14px; right: 14px; bottom: 46px; display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line-2);
  background: rgba(5,8,17,.7); backdrop-filter: blur(6px); }
.orbit__bar i { width: 34%; height: 4px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.orbit__bar span { font: 500 9.5px/1 var(--mono); letter-spacing: .14em; color: var(--fg-2); }

/* 11 · lab split */
.plate--lab { padding: 26px 26px 58px; }
.split { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: start; }
.split__side { display: grid; gap: 9px; }
.split__side b { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; color: var(--fg); margin-bottom: 6px; }
.split__side span { padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line);
  font-size: .8rem; color: var(--fg-2); background: var(--bg); }
.split__side--tech b { color: var(--accent); }
.split__side--tech span { border-color: rgba(214,186,120,.28); }
.split__rule { width: 1px; align-self: stretch; background: linear-gradient(to bottom, transparent, var(--line-2), transparent); }

/* 12 · terminal */
.plate--now { padding: 26px 26px 58px; }
.term { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #070b14; }
.term__bar { display: flex; align-items: center; gap: 6px; padding: 10px 13px; border-bottom: 1px solid var(--line); background: #0b1120; }
.term__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(190,205,228,.22); }
.term__bar span { margin-left: 8px; font: 400 10px/1 var(--mono); color: var(--fg-3); }
.term__body { display: grid; gap: 10px; padding: 20px 18px 26px; }
.term__line { font: 400 .82rem/1.5 var(--mono); color: var(--fg-2); }
.term__line b { color: var(--accent); font-weight: 500; margin-right: 8px; }
.term__line--dim { color: var(--fg-3); }
.term__cursor { display: inline-block; width: 8px; height: 15px; margin-left: 8px; vertical-align: text-bottom;
  background: var(--accent); animation: cm-blink 1.1s steps(1) infinite; }
@keyframes cm-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .term__cursor { animation: none; } }

/* ---------- reels (video slots) ---------- */
.reel { cursor: default; }
.reel__placeholder { position: relative; min-height: 280px; display: block; }
.reel__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 66px; height: 66px; border-radius: 50%; border: 1px solid rgba(214,186,120,.5);
  background: rgba(5,8,17,.55); cursor: default; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 34px -8px var(--accent-glow);
}
.reel__play svg { width: 24px; height: 24px; fill: var(--accent); margin-left: 3px; }
.reel.has-video .reel__placeholder { display: none; }
.reel video { display: block; width: 100%; height: auto; background: #000; }
.reel .reel__overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,17,.35); cursor: pointer; border: 0; width: 100%;
  transition: opacity .4s var(--ease), visibility .4s;
}
.reel .reel__overlay.is-hidden { opacity: 0; visibility: hidden; }
.reel__title {
  position: absolute; left: 18px; bottom: 14px; z-index: 3;
  font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2);
  text-shadow: 0 1px 8px rgba(0,0,0,.8); pointer-events: none;
}

/* ---------- closing ---------- */
.closing { position: relative; z-index: 2; overflow: hidden; padding: 150px 0 320px; text-align: center;
  background: var(--bg); }
.closing__quote { max-width: 860px; margin: 0 auto; }
.closing__attr { margin-top: 26px; font: 500 12px/1.8 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.closing__cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 46px; position: relative; z-index: 3; }
.closing .cta__layer { position: absolute; left: 50%; transform: translateX(-50%); bottom: -2px; width: 110%; min-width: 1200px; z-index: 1; pointer-events: none; }
.closing .cta__layer--mid { opacity: .55; }
@media (max-width: 900px) { .closing { padding: 90px 0 220px; } }
