/* =====================================================
   Emberly — shared stylesheet
   Pure black, Inter, liquid glass
   ===================================================== */

/* -----------------------------------------------------
   Self-hosted fonts. Same-origin → ~10-30ms load on
   Vercel CDN, so 'optional' lets them paint correctly
   on first frame without ever showing a fallback swap.
   ----------------------------------------------------- */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url('/fonts/InterVariable.woff2') format('woff2-variations'),
       url('/fonts/InterVariable.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter Variable';
  font-style: italic;
  font-weight: 100 900;
  font-display: optional;
  src: url('/fonts/InterVariable-Italic.woff2') format('woff2-variations'),
       url('/fonts/InterVariable-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/InstrumentSerif-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/InstrumentSerif-Italic.woff2') format('woff2');
}

/* Metric-matched fallbacks. If the local font misses the
   ~100ms 'optional' window (rare on cached visits), the
   fallback below renders instead — but already at the
   right metrics so nothing reflows when the real font
   eventually paints on the next visit. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Helvetica Neue'), local('Helvetica'), local('Arial');
  ascent-override: 90%;
  descent-override: 22.43%;
  line-gap-override: 0%;
  size-adjust: 107.64%;
}
@font-face {
  font-family: 'Instrument Serif Fallback';
  src: local('Iowan Old Style'), local('Hoefler Text'), local('Cambria'), local('Charter'), local('Georgia');
  ascent-override: 92%;
  descent-override: 22%;
  size-adjust: 96%;
}

/* -----------------------------------------------------
   Liquid page transitions + entrance + scroll reveals
   ----------------------------------------------------- */

/* Cross-document View Transitions (Chrome 126+, Safari 18+).
   Falls back to instant navigation in unsupported browsers. */
@view-transition {
  navigation: auto;
}

/* Lighter, faster, no-blur transitions — eliminates perceived lag */
::view-transition-old(root) {
  animation: vtOut 0.26s cubic-bezier(.4, 0, 0.2, 1) both;
}
::view-transition-new(root) {
  animation: vtIn 0.42s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes vtOut {
  to { opacity: 0; }
}
@keyframes vtIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* PERSISTENT NAV — never flicker, never re-mount visually.
   The nav gets its own snapshot group via view-transition-name,
   and we explicitly hide the old snapshot + show the new one
   instantly so no cross-fade is perceived. */
.nav { view-transition-name: emberly-nav; }
::view-transition-group(emberly-nav) { animation-duration: 0s; }
::view-transition-image-pair(emberly-nav) { isolation: auto; }
::view-transition-old(emberly-nav) { animation: none !important; opacity: 0; }
::view-transition-new(emberly-nav) { animation: none !important; opacity: 1; }

/* No body-level fade.  Body paints solid black instantly so the user
   is never staring at a blank/dimmed screen waiting for JS.  Hero
   elements then run their own CSS animation independent of JS. */

/* -----------------------------------------------------
   Hero fade-up (immediate, CSS-only, snappy easing)
   Fires the moment the stylesheet loads — no JS, no observer.
   Use inline style="--d: .12s" to stagger per element.
   ----------------------------------------------------- */
.hero-fade {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  animation: heroFadeUp 0.55s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--d, 0s);
  will-change: transform, opacity;
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* -----------------------------------------------------
   Reveal (luxurious, observer-driven, below-fold + cascade)
   --reveal-i: sibling index in DOM order set by admin.js
   --reveal-base: 0.3s for items visible on first paint
                  (so they trail the hero gracefully); 0 for
                  scrolled-in items so they fade up instantly.
   ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 1.15s cubic-bezier(.22, 1, .36, 1),
    transform 1.15s cubic-bezier(.22, 1, .36, 1);
  transition-delay: calc(var(--reveal-base, 0s) + var(--reveal-i, 0) * 130ms);
  will-change: transform, opacity;
}
.reveal.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Case study cards: heavier, more deliberate weight */
.case.reveal {
  transform: translate3d(0, 36px, 0);
  transition-duration: 1.35s;
}

/* Reduced motion: kill all the choreography. */
@media (prefers-reduced-motion: reduce) {
  .hero-fade,
  .reveal,
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(emberly-nav),
  ::view-transition-new(emberly-nav) {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


:root {
  --bg: #000000;
  --ink: #ffffff;
  --muted: rgba(255,255,255,0.62);
  --muted-2: rgba(255,255,255,0.48);
  --line: rgba(255,255,255,0.10);
  --line-2: rgba(255,255,255,0.18);
  --accent: #ff6a3d;
  --max: 1240px;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --serif: 'Instrument Serif', 'Instrument Serif Fallback', 'Iowan Old Style', 'Hoefler Text', 'Cambria', 'Georgia', serif;
  --sans: 'Inter Variable', 'Inter Fallback', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --glass-bg: rgba(255,255,255,0.04);
  --glass-bg-strong: rgba(20,20,20,0.62);
  --glass-border: rgba(255,255,255,0.10);
  --glass-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.05) inset;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  min-height: 100vh;
  overflow-x: hidden;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: #fff; color: #000; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Liquid glass nav ---------- */
.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 10px 14px 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--glass-shadow);
  max-width: calc(100vw - 24px);
}
.nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.10);
}
.nav .brand .logo-mark {
  width: 22px; height: 22px;
  display: inline-block;
  object-fit: contain;
}
.nav .brand .name {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: #fff;
  text-transform: uppercase;
}
.nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255,255,255,0.62);
  transition: color .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: #fff; }
.nav a .pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.nav a.is-active {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.nav a.is-active .pip { opacity: 1; transform: scale(1); }

.nav-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 50%;
  position: relative;
  padding: 0;
  color: rgba(255,255,255,0.85);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.6px;
  background: currentColor;
  border-radius: 1px;
  position: absolute;
  left: 10px;
  transition: transform .25s var(--ease), opacity .2s var(--ease), top .25s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 18px; }
.nav-toggle span:nth-child(3) { top: 23px; }
.nav-toggle.open span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  /* Full-width edge-to-edge nav, container expands within itself */
  .nav {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    padding: 14px 20px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 24px -16px rgba(0,0,0,0.85);
  }
  .nav .brand { padding-right: 0; border-right: 0; }
  .nav .brand .name { font-size: 13px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav ul {
    position: static;
    transform: none;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    opacity: 0.95;
    pointer-events: none;
    transition: max-height .4s var(--ease), margin-top .25s var(--ease), padding-top .25s var(--ease), opacity .2s var(--ease);
  }
  .nav ul.open {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .nav ul li { width: 100%; }
  .nav ul a {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 14px;
    font-size: 15px;
    border-radius: 12px;
    letter-spacing: 0.01em;
  }
  .nav ul a.is-active { background: rgba(255,255,255,0.06); }
}

/* ---------- Sections / type ---------- */
section {
  position: relative;
  padding: clamp(110px, 16vh, 200px) var(--pad);
  scroll-margin-top: 90px;
}
.wrap { max-width: var(--max); margin: 0 auto; }

.eyebrow,
.page-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  display: inline-block;
}
.page-eyebrow { display: block; margin-bottom: 18px; }
.page-h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 88px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-lede {
  color: rgba(255,255,255,0.72);
  max-width: 60ch;
  margin: 18px auto 0;
  font-size: 17px;
  line-height: 1.6;
}

.mark { position: relative; display: inline-block; padding: 0 0.06em; white-space: nowrap; }
.mark .underline {
  position: absolute; inset: auto 0 -16% 0;
  width: 100%; height: 30%;
  pointer-events: none; overflow: visible;
}
.mark .underline path {
  fill: none; stroke: #ffffff; stroke-width: 6;
  stroke-linecap: round; opacity: 0.92;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid #fff;
  background: #fff;
  color: #000;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.btn.ghost:hover { border-color: #fff; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.danger {
  background: rgba(255,80,80,0.12);
  border-color: rgba(255,80,80,0.35);
  color: #ff8a8a;
}

/* ---------- Glass card ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: clamp(28px, 3vw, 40px);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 40%);
}

/* ---------- Hero (content only, full height) ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 120px); /* leave room for status strip */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(140px, 16vh, 200px) var(--pad) clamp(60px, 8vh, 100px);
}
.hero .inner {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  gap: clamp(26px, 3.6vh, 40px);
  justify-items: center;
  width: 100%;
}
.hero h1 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(44px, 6.4vw, 100px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: uppercase;
}
.hero .subhead-block {
  display: grid;
  gap: clamp(10px, 1.6vh, 16px);
  max-width: 66ch;
  margin: 0 auto;
}
.hero .subhead-line {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0;
  margin: 0;
}
.hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
}

/* ---------- Status strip (between hero and footer) ---------- */
.status-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(18px, 2.5vh, 32px) var(--pad);
  gap: 24px;
}
.clock-corner {
  color: rgba(245,240,235,0.82);
  font-family: var(--sans);
  user-select: none;
}
.clock-corner .clock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.clock-corner .live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(245,240,235,0.55);
  display: inline-block;
  animation: clockPulse 2.4s ease-in-out infinite;
}
@keyframes clockPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.clock-corner .clock-loc {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,240,235,0.42);
  margin-top: 6px;
  margin-left: 17px;
}
.globe-corner {
  width: clamp(72px, 8vw, 110px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.95;
}
.globe-corner svg { width: 100%; height: 100%; display: block; }
.globe-corner svg circle,
.globe-corner svg ellipse { stroke: #ffffff; }

@media (max-width: 600px) {
  .clock-corner .clock-row { font-size: 13px; }
  .globe-corner { width: 64px; }
}

/* ---------- Footer ---------- */
footer {
  padding: 32px var(--pad) 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
}
footer .row {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 20px;
  flex-wrap: wrap;
}
footer a { color: rgba(255,255,255,0.5); }
footer a:hover { color: #fff; }
.footer-admin { font-size: 12px; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* =====================================================
   Advisory
   ===================================================== */
.advisory-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 6vw, 80px);
  max-width: 1080px;
  margin: 0 auto;
  align-items: stretch;
}
@media (max-width: 900px) { .advisory-grid { grid-template-columns: 1fr; } }
.advisory-text p {
  color: rgba(255,255,255,0.78);
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 18px;
  max-width: 50ch;
}
.advisory-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 14px 0 22px;
  letter-spacing: -0.01em;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; color: rgba(255,255,255,0.85);
}
.pill .dot { width: 6px; height: 6px; background: #5fe07a; border-radius: 50%; display: inline-block; }
.advisory-cta { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

.advisory-card p.lede {
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 18px;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: clamp(72px, 9vw, 120px) auto 0;
}
@media (max-width: 820px) { .principles { grid-template-columns: 1fr; } }
.principle h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.principle p { margin: 0; color: rgba(255,255,255,0.7); font-size: 15px; line-height: 1.6; }

/* =====================================================
   Brands page — bold stacked layout
   ===================================================== */
.portfolio-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(60px, 8vw, 110px) 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  align-items: start;
}
.portfolio-row:last-of-type { border-bottom: 1px solid rgba(255,255,255,0.08); }
.portfolio-row .row-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding-top: 10px;
}
.portfolio-row .row-label .bracket {
  font-family: var(--sans);
  color: rgba(255,255,255,0.35);
}
.portfolio-row .row-actions {
  margin-top: 12px;
  display: none;
}
body.admin-mode .portfolio-row .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.portfolio-stack {
  display: grid;
  gap: clamp(10px, 1.6vw, 18px);
  justify-items: center;
  text-align: center;
}
.portfolio-line {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.portfolio-big {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(40px, 8vw, 112px);
  letter-spacing: -0.02em;
  line-height: 1.0;
  cursor: pointer;
  color: #fff;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 4px 10px;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.portfolio-big:hover { opacity: 0.55; }

.line-actions {
  display: none;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
body.admin-mode .line-actions {
  display: inline-flex;
  opacity: 0.6;
  transform: none;
}
.portfolio-line:hover .line-actions { opacity: 1; }
.icon-btn {
  appearance: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.32);
  color: #fff;
}
.icon-btn.danger:hover {
  background: rgba(255,80,80,0.14);
  border-color: rgba(255,120,120,0.55);
  color: #ff9a9a;
}
.icon-btn svg { width: 15px; height: 15px; }

.portfolio-add {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.55);
  padding: 18px 28px;
  border-radius: 16px;
  font-size: 13px;
  font-family: var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
body.admin-mode .portfolio-add { display: inline-flex; }
.portfolio-add:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.03);
}

/* Inline expand panel — accordion style under each brand */
.portfolio-expand {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .35s var(--ease), opacity .25s var(--ease), margin-top .35s var(--ease);
  margin-top: 0;
}
.portfolio-expand.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: clamp(12px, 1.6vw, 18px);
}
.portfolio-expand .expand-inner {
  overflow: hidden;
  text-align: center;
  display: grid;
  gap: 10px;
}
.portfolio-expand .pe-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.portfolio-expand .pe-desc {
  color: rgba(255,255,255,0.78);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.65;
  margin: 0;
}
.portfolio-expand .pe-visit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 2px 0;
  margin-top: 4px;
}
.portfolio-expand .pe-visit:hover { color: #fff; border-color: #fff; }

.portfolio-big.is-open { opacity: 0.85; }
.portfolio-big.is-open::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  margin-left: 14px;
  vertical-align: middle;
  transform: rotate(-135deg);
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .portfolio-row { grid-template-columns: 1fr; gap: 16px; }
  .portfolio-row .row-label { padding-top: 0; }
}

/* Description modal name */
.pf-modal-name {
  font-family: var(--sans);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 4px;
  line-height: 1;
}

/* =====================================================
   Careers
   ===================================================== */
.role-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center;
  margin: 8px 0 36px;
}
.chip {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s var(--ease);
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 11px; color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: #fff; color: #fff; }
.chip.is-active { background: #fff; color: #000; border-color: #fff; }
.chip.is-active .count { background: rgba(0,0,0,0.12); color: #000; }

.role-categories {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: clamp(40px, 5vw, 64px);
}
.role-cat-block { display: grid; gap: 18px; }
.role-cat-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.role-cat-head h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  margin: 0; letter-spacing: -0.01em;
}
.role-cat-head .cat-count {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
}
.role-cat-head .add-role {
  margin-left: auto;
  display: none;
}
body.admin-mode .role-cat-head .add-role { display: inline-flex; }

.role-list { display: grid; gap: 12px; }
.role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(40px, 8vw, 140px);
  padding: 26px 36px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
  cursor: pointer;
}
.role .role-cta,
.role .role-admin-actions { margin-left: auto; flex-shrink: 0; }
.role .left { flex: 1 1 auto; }
.role:hover {
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
}
.role .handle {
  width: 20px; height: 20px;
  display: none;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4);
  cursor: grab;
}
.role .handle:active { cursor: grabbing; }
body.admin-mode .role .handle { display: inline-flex; }
body.admin-mode .role { cursor: default; }
body.admin-mode .role:hover { transform: none; }
.role.dragging { opacity: 0.4; }
.role.drag-over { border-color: var(--accent) !important; }

.role .left { display: grid; gap: 6px; min-width: 0; }
.role .role-meta {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.role .role-title {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  font-weight: 400;
}
.role .role-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  transition: color .2s var(--ease), transform .2s var(--ease);
  padding-right: 4px;
}
.role .role-cta svg {
  width: 14px;
  height: 14px;
  transition: transform .25s var(--ease);
}
.role:hover .role-cta { color: #fff; }
.role:hover .role-cta svg { transform: translateX(4px); }
.role:active { background: rgba(255,255,255,0.09); }
.role .role-admin-actions { display: none; gap: 6px; }
body.admin-mode .role .role-admin-actions { display: inline-flex; }
body.admin-mode .role .arrow { display: none; }

@media (max-width: 600px) {
  .role { grid-template-columns: auto 1fr; row-gap: 12px; }
  .role .arrow, .role .role-admin-actions { grid-column: 2; justify-self: end; }
}

/* =====================================================
   Case studies
   ===================================================== */
.cs-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 56px;
}
.cs-actions {
  display: none;
  justify-content: center;
  margin-bottom: 24px;
}
body.admin-mode .cs-actions { display: flex; }

.case-list {
  display: grid; grid-template-columns: 1fr;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.case {
  padding: clamp(28px, 4vw, 44px) 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) 1.5fr 220px;
  gap: clamp(24px, 3.5vw, 56px);
  align-items: start;
  transition: background .25s var(--ease), border-color .2s var(--ease);
  position: relative;
}
.case:hover { background: rgba(255,255,255,0.025); }
.case.dragging { opacity: 0.4; }
.case.drag-over { border-color: var(--accent) !important; background: rgba(255,140,80,0.04); }
.case .case-handle {
  position: absolute;
  left: -30px;
  top: clamp(32px, 4.5vw, 50px);
  width: 22px; height: 22px;
  display: none;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4);
  cursor: grab;
}
.case .case-handle:active { cursor: grabbing; }
body.admin-mode .case .case-handle { display: inline-flex; }
body.admin-mode .case { cursor: grab; }
.case .name-block .name-big {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.case .name-block .name-sub {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: 0.01em;
}
.case .name-block .name-meta {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(255,255,255,0.42);
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.case .story {
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
  font-size: 15.5px;
  max-width: 60ch;
}
.case .meta { display: grid; gap: 10px; align-content: start; }
.case .meta .row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  font-size: 13px;
  align-items: baseline;
}
.case .meta .k {
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}
.case .meta .v { font-weight: 500; color: #fff; }
.case .delete-case {
  display: none;
  position: absolute;
  top: 12px; right: 0;
  appearance: none;
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.35);
  color: #ff8a8a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}
body.admin-mode .case .delete-case { display: inline-flex; }

@media (max-width: 980px) {
  .case { grid-template-columns: 1fr; }
  .case .story { grid-column: 1 / -1; }
  .case .meta { grid-column: 1 / -1; }
  .case .meta .row { grid-template-columns: 90px 1fr; }
}

/* =====================================================
   Admin mode
   ===================================================== */
body.admin-mode [data-edit] {
  outline: 1px dashed rgba(255,140,80,0.45);
  outline-offset: 4px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color .2s var(--ease);
}
body.admin-mode [data-edit]:hover { outline-color: rgba(255,140,80,0.85); }
body.admin-mode [data-edit]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.admin-bar {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 8px 14px;
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--glass-shadow);
  max-width: calc(100vw - 24px);
}
.admin-bar .ab-divider {
  width: 1px; height: 22px;
  background: rgba(255,255,255,0.12);
  margin: 0 4px;
  flex-shrink: 0;
}
.admin-bar .ab-icon {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.85);
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  flex-shrink: 0;
  position: relative;
}
.admin-bar .ab-icon svg { width: 16px; height: 16px; }
.admin-bar .ab-icon:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: #fff;
}
.admin-bar .ab-icon.primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
.admin-bar .ab-icon.primary:hover { background: #f0f0f0; border-color: #f0f0f0; }
.admin-bar .ab-icon.danger { color: rgba(255,160,160,0.92); }
.admin-bar .ab-icon.danger:hover {
  background: rgba(255,80,80,0.12);
  border-color: rgba(255,80,80,0.35);
  color: #ff8a8a;
}
.admin-bar .ab-icon[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(20,20,20,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s var(--ease);
  font-family: var(--sans);
}
.admin-bar .ab-icon[title]:hover::after { opacity: 1; }
body.admin-mode .admin-bar { display: inline-flex; }
.admin-bar .badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: #fff;
}
.admin-bar .badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.admin-bar button {
  appearance: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.admin-bar button:hover { background: rgba(255,255,255,0.16); }
.admin-bar button.primary {
  background: #fff; color: #000; border-color: #fff;
}
.admin-bar .saved-flash {
  font-size: 12px;
  color: #5fe07a;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.admin-bar .saved-flash.show { opacity: 1; }
.admin-bar button[disabled] { opacity: 0.55; cursor: progress; }
.admin-bar .ab-icon.is-busy svg {
  animation: abSpin 1s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes abSpin {
  to { transform: rotate(360deg); }
}

/* Admin dashboard / settings panels (full-screen overlays) */
.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  padding: 80px 24px 100px;
  overflow-y: auto;
}
.admin-panel.open { display: block; }
.admin-panel .ap-inner {
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(15,15,15,0.92);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.admin-panel .ap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-panel .ap-head h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}
.admin-panel .ap-head .ap-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.admin-panel .ap-close {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.admin-panel .ap-close:hover { background: rgba(255,255,255,0.14); }
.admin-panel .ap-body { padding: 24px 28px 32px; }

/* Application list */
/* Tab strip: Active / Archive */
.app-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  margin-bottom: 16px;
}
.app-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.6);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
  font-family: inherit;
}
.app-tabs button:hover { color: #fff; }
.app-tabs button.is-active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.app-tabs .ap-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 16px;
  padding: 0 6px; margin-left: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* Filter bar */
.app-filters {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.app-filters input[type="date"],
.app-filters select {
  background-color: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  min-width: 0;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.app-filters input[type="date"]:hover,
.app-filters select:hover {
  border-color: rgba(255,255,255,0.28);
  background-color: rgba(255,255,255,0.06);
}
.app-filters input[type="date"]:focus,
.app-filters select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.55);
  background-color: rgba(255,255,255,0.06);
}
.app-filters input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.55);
  cursor: pointer;
  transition: opacity .15s ease;
  margin-left: 4px;
}
.app-filters input[type="date"]:hover::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.9); }
.app-filters input[type="date"]::-webkit-datetime-edit-fields-wrapper { color: #fff; }
.app-filters input[type="date"]::-webkit-datetime-edit-text { color: rgba(255,255,255,0.4); padding: 0 2px; }
.app-filters input[type="date"]::-webkit-datetime-edit-month-field,
.app-filters input[type="date"]::-webkit-datetime-edit-day-field,
.app-filters input[type="date"]::-webkit-datetime-edit-year-field { color: #fff; }
.app-filters input[type="date"]:not([value]):not(:focus)::-webkit-datetime-edit { color: rgba(255,255,255,0.4); }
.app-filters .af-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.app-filters .af-reset {
  margin-left: auto;
  appearance: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  border: 0;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 10px;
}
.app-filters .af-reset:hover { color: #fff; }
@media (max-width: 760px) {
  .app-filters { grid-template-columns: 1fr 1fr; }
  .app-filters .af-reset { grid-column: 1 / -1; justify-self: end; }
}

.app-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.app-toolbar .app-stat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.app-toolbar .app-stat strong { color: #fff; font-weight: 600; }
.app-toolbar .ap-refresh,
.app-toolbar .ap-export {
  margin-left: auto;
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.app-toolbar .ap-refresh:hover,
.app-toolbar .ap-export:hover { background: rgba(255,255,255,0.12); }
.app-toolbar .ap-export { margin-left: 0; }

/* Quick action buttons on cards (✓ / ✗) */
.app-card .ac-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.app-card .ac-act {
  appearance: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.app-card .ac-act svg { width: 14px; height: 14px; }
.app-card .ac-act.ok:hover {
  background: rgba(95,224,122,0.18);
  border-color: rgba(95,224,122,0.5);
  color: #5fe07a;
}
.app-card .ac-act.archive:hover {
  background: rgba(255,140,80,0.16);
  border-color: rgba(255,140,80,0.45);
  color: #ffb38a;
}
.app-card.is-busy { opacity: 0.55; pointer-events: none; }

.app-empty {
  padding: 60px 30px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 16px;
}
.app-empty h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: #fff;
  margin: 0 0 6px;
  font-size: 22px;
}
.app-list {
  display: grid;
  gap: 10px;
}
.app-card {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.app-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  transform: translateX(2px);
}
.app-card .ac-chevron {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: transform .25s var(--ease), background .15s var(--ease);
}
.app-card.is-open .ac-chevron { transform: rotate(180deg); background: rgba(255,255,255,0.12); }
.app-card .ac-chevron svg { width: 12px; height: 12px; }
.app-detail {
  display: none;
  margin: -4px 0 8px;
}
.app-detail.is-open { display: block; }
.app-card .ac-name {
  font-weight: 500;
  font-size: 15px;
  color: #fff;
}
.app-card .ac-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  margin-top: 3px;
}
.app-card .ac-role {
  font-size: 13px;
  color: rgba(255,255,255,0.78);
}
.app-card .ac-date {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.app-card .ac-status {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,140,80,0.14);
  border: 1px solid rgba(255,140,80,0.32);
  color: #ffb38a;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .app-card { grid-template-columns: 1fr; gap: 4px; }
  .app-card .ac-date, .app-card .ac-status { justify-self: start; }
}

/* App detail expanded */
.app-detail {
  margin-top: 8px;
  padding: 18px 20px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.app-detail .ad-section {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 18px;
  font-size: 13.5px;
  line-height: 1.55;
}
.app-detail .ad-section .ad-key {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 2px;
}
.app-detail .ad-section .ad-val {
  color: rgba(255,255,255,0.92);
  word-break: break-word;
}
.app-detail .ad-mailto {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* Settings panel content */
.settings-section {
  padding: 22px 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  margin-bottom: 12px;
}
.settings-section h4 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  margin: 0 0 6px;
}
.settings-section p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.65);
  line-height: 1.55;
}
.settings-section .ss-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.settings-section .ss-row:last-child { margin-bottom: 0; }
.settings-section .ss-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
}
.settings-section .ss-status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}
.settings-section .ss-status.ok { color: #c6f5d2; }
.settings-section .ss-status.ok::before { background: #5fe07a; box-shadow: 0 0 8px rgba(95,224,122,0.6); }
.settings-section .ss-status.warn { color: #ffd0b3; }
.settings-section .ss-status.warn::before { background: #ffb38a; }
.settings-section .field { margin-bottom: 12px; }
.settings-section .field label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: block;
  margin-bottom: 6px;
}
.settings-section input[type="password"],
.settings-section input[type="text"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.settings-section input[type="password"]:focus,
.settings-section input[type="text"]:focus {
  outline: none;
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
}
.settings-section .ss-error {
  font-size: 13px;
  color: #ff8a8a;
  margin-top: -4px;
  margin-bottom: 12px;
  display: none;
}
.settings-section .ss-error.show { display: block; }

/* Collapsible Advanced section */
.advanced-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 18px 4px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 18px;
}
.advanced-toggle:hover { color: #fff; }
.advanced-toggle .at-chevron {
  display: inline-flex;
  width: 14px; height: 14px;
  transition: transform .25s var(--ease);
}
.advanced-toggle.open .at-chevron { transform: rotate(180deg); }
.advanced-body { display: none; }
.advanced-body.open { display: block; }

/* Default field editor in admin role modal */
.ff-list { display: grid; gap: 8px; margin-top: 6px; }
.ff-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}
.ff-row input[type="text"] {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
.ff-row .ff-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.ff-row .ff-toggle input { width: 14px; height: 14px; cursor: pointer; }

/* Token setup modal — step list */
.token-steps {
  margin: 0 0 20px;
  padding: 16px 18px 16px 36px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: rgba(255,255,255,0.78);
  font-size: 13.5px;
  line-height: 1.65;
}
.token-steps li { margin-bottom: 4px; }
.token-steps a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.3); }
.token-steps a:hover { border-color: #fff; }
.token-steps b { color: #fff; font-weight: 500; }

/* Publish toast (bottom-center, sits above the admin bar) */
.publish-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 14px) scale(0.96);
  z-index: 90;
  padding: 14px 22px;
  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  font-size: 14px;
  color: rgba(255,255,255,0.95);
  letter-spacing: -0.005em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .35s var(--ease-out);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.85);
  max-width: min(420px, calc(100vw - 40px));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.publish-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.publish-toast::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: tPulse 1.2s ease-in-out infinite;
}
.publish-toast.success::before {
  background: #5fe07a;
  box-shadow: 0 0 14px rgba(95,224,122,0.6);
  animation: none;
}
.publish-toast.error::before {
  background: #ff8a8a;
  box-shadow: 0 0 14px rgba(255,138,138,0.5);
  animation: none;
}
.publish-toast.success {
  border-color: rgba(95,224,122,0.45);
  color: #d2f5db;
  background: linear-gradient(180deg, rgba(28,40,32,0.96), rgba(20,28,22,0.96));
}
.publish-toast.error {
  border-color: rgba(255,120,120,0.5);
  color: #ffd0d0;
  background: linear-gradient(180deg, rgba(40,28,28,0.96), rgba(28,20,20,0.96));
}
@keyframes tPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%;
  max-width: 560px;
  background: rgba(15,15,15,0.92);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--glass-shadow);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal.wide { max-width: 640px; }

/* Lock body scroll while any modal/panel is open (no JS needed) */
html:has(.modal-backdrop.open),
html:has(.admin-panel.open) {
  overflow: hidden;
}

/* ----- Mobile: full-bleed modal with safe-area insets ----- */
@media (max-width: 760px) {
  .modal-backdrop {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
  }
  .modal,
  .modal.wide,
  .modal.xwide {
    max-width: 100%;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding:
      calc(env(safe-area-inset-top, 0px) + 56px)
      20px
      calc(env(safe-area-inset-bottom, 0px) + 110px)
      20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal > .close {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    right: 14px;
    z-index: 5;
    background: rgba(20,20,20,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .modal .row-2 { grid-template-columns: 1fr; gap: 0; }
  .modal h3 { margin-top: 4px; }
  /* Sticky action bar at the bottom of every modal on mobile */
  .modal .actions {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    flex-direction: row;
    justify-content: stretch;
    gap: 10px;
    padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 14px) 16px;
    background: linear-gradient(180deg, rgba(15,15,15,0) 0%, rgba(10,10,10,0.92) 32%, rgba(10,10,10,0.98) 100%);
    z-index: 6;
    margin: 0;
  }
  .modal .actions .btn,
  .modal .actions button {
    flex: 1 1 0;
    justify-content: center;
    padding: 14px 16px;
    font-size: 15px;
  }
  /* JD view stacking on narrow viewports */
  .jd-cols { grid-template-columns: 1fr; gap: 24px; }
  .jd-header { flex-direction: column; align-items: stretch; }
  .jd-apply { width: 100%; padding: 14px 24px; }
}
.modal h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.modal .modal-sub {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  margin: 0 0 24px;
}
.modal .field { display: grid; gap: 6px; margin-bottom: 16px; }
.modal label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.modal input,
.modal textarea,
.modal select {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
}
.modal textarea { resize: vertical; min-height: 90px; }

/* Unified select styling across the site */
select,
.modal select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(255,255,255,0.04);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='1,1.5 6,6.5 11,1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px;
  padding-right: 38px !important;
  cursor: pointer;
  color: #fff;
  font-family: var(--sans);
}
select:hover,
.modal select:hover {
  background-color: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
}
select option,
.modal select option {
  background: #1a1a1a;
  color: #fff;
  padding: 8px;
}
.modal .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .modal .row-2 { grid-template-columns: 1fr; } }
.modal .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}
.modal .close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.modal .close:hover { background: rgba(255,255,255,0.14); }
.modal .success { display: none; text-align: center; padding: 16px 0 4px; }
.modal .success.show { display: block; }
.modal .success .check {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(95,224,122,0.12);
  border: 1px solid rgba(95,224,122,0.4);
  display: inline-flex; align-items: center; justify-content: center;
  color: #5fe07a;
}
.modal .success p { color: rgba(255,255,255,0.7); margin: 0; }

/* Job description view inside apply modal */
.jd-view { display: none; }
.jd-view.show { display: grid; gap: clamp(20px, 3vh, 30px); }

.jd-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.jd-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.04);
  font-weight: 400;
}
.jd-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.jd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.jd-title-block { min-width: 0; }
.jd-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
}
.jd-header .jd-meta {
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
  margin-top: 12px;
  letter-spacing: 0.02em;
}
.jd-apply {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 13px 30px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 100%);
  color: #000;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  box-shadow:
    0 12px 30px -10px rgba(255,255,255,0.18),
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 -1px 0 rgba(0,0,0,0.05) inset;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
  flex-shrink: 0;
  font-family: inherit;
}
.jd-apply:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 36px -10px rgba(255,255,255,0.28),
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 -1px 0 rgba(0,0,0,0.05) inset;
}

.jd-tagline {
  color: rgba(255,255,255,0.85);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.55;
  margin: 0;
  max-width: 60ch;
}

.jd-about {
  padding: 22px 26px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}
.jd-about-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
  font-weight: 500;
}
.jd-about p {
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-size: 14.5px;
  line-height: 1.55;
}

.jd-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding-top: 4px;
}
.jd-col h4 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0 0 14px;
  font-weight: 500;
  font-family: var(--sans);
}
.jd-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.jd-col li {
  position: relative;
  padding-left: 18px;
  color: rgba(255,255,255,0.84);
  font-size: 14.5px;
  line-height: 1.5;
}
.jd-col li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
}
.jd-desc {
  color: rgba(255,255,255,0.78);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0;
}

@media (max-width: 600px) {
  .jd-cols { grid-template-columns: 1fr; gap: 24px; }
  .jd-header { flex-direction: column; align-items: flex-start; }
  .jd-apply { width: 100%; padding: 14px 24px; }
}

/* Wider modal for JD */
.modal.xwide { max-width: 820px; }

/* Custom question builder (admin) */
.qb-list { display: grid; gap: 10px; margin-top: 6px; }
.qb-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}
.qb-item textarea { min-height: 38px; }
.qb-item .opts {
  grid-column: 1 / -1;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.qb-item .remove {
  appearance: none;
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.35);
  color: #ff8a8a;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  height: 32px;
}
.qb-add {
  appearance: none;
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
}
.qb-add:hover { color: #fff; border-color: #fff; }

/* Custom question render in apply form */
.custom-q { display: grid; gap: 6px; margin-bottom: 16px; }
.custom-q .checkbox-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.custom-q input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  margin: 0;
}
