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

:root {
  font-size: 15px;
  --color-text: #fff;
  --color-bg: #0a0a0a;
  --color-link: #aaa;
  --color-link-hover: #fff;
  --accent: #ff5722;
  --accent-soft: rgba(255, 87, 34, 0.18);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.22);
  --display-font: 'Boldonse', 'Archivo Black', 'Arial Black', system-ui, sans-serif;
  --ui-font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono-font: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* Settings hydration gate — see <head> inline script + admin.js bootstrapPublic.
   The "settings-cached" class is added IMMEDIATELY (DOMContentLoaded) by the
   hydration script when localStorage has cached settings — so repeat visitors
   see their saved values from the very first paint, no flash of defaults.
   "settings-ready" is added when the live /api/settings fetch completes. We
   only fade-in if NEITHER class is present yet (first-time visitor) — this
   gives them a brief 100-200ms blank instead of a flash of wrong defaults. */
body {
  opacity: 0;
  transition: opacity 0.35s ease;
}
body.settings-cached,
body.settings-ready {
  opacity: 1;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  transition: color 0.2s ease;
}

a:hover, a:focus { color: var(--color-link-hover); }

/* hide dat.gui completely just in case */
.dg.ac, .dg.main { display: none !important; }

main {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* -------- Frame (corner brand UI) -------- */
.frame {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  padding: 2.4rem 2.6rem;
  z-index: 10;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "title    contact"
    ".        ."
    ".        tagline";
}

.frame__title {
  grid-area: title;
  margin: 0;
  font-family: var(--ui-font);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
}

.frame__tagline {
  grid-area: tagline;
  justify-self: end;
  align-self: end;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #888;
}

.frame__contact-btn {
  grid-area: contact;
  justify-self: end;
  align-self: start;
  pointer-events: auto;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: #eaeaea;
  padding: 0.7rem 1.3rem 0.7rem 1.0rem;
  border-radius: 999px;
  font-family: var(--ui-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.frame__contact-btn:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}

.frame__contact-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255,87,34,0.6);
  animation: pulse-dot 2.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,87,34, 0.65); }
  50%      { box-shadow: 0 0 0 8px rgba(255,87,34, 0); }
}

/* -------- Cube stage -------- */
.content {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.content canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* -------- Hint -------- */
.hint {
  position: fixed;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #555;
  pointer-events: none;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.35; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 0.85; transform: translateX(-50%) translateY(-3px); }
}

/* -------- Buttons -------- */
.btn {
  font-family: var(--ui-font);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.btn--primary {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: #ff7043;
  border-color: #ff7043;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: #ccc;
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.accent { color: var(--accent); }

/* -------- Welcome overlay (cube click) -------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
}

.welcome-overlay.is-active {
  pointer-events: auto;
  opacity: 1;
}

.welcome-overlay__ripple {
  position: absolute;
  top: var(--ripple-y, 50%);
  left: var(--ripple-x, 50%);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 1;
}

/* Each ring is a translucent circle border that expands like a real water ripple */
.welcome-overlay__ripple-ring,
.welcome-overlay__ripple-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center;
  pointer-events: none;
  will-change: transform, opacity, border-width, box-shadow;
}

.welcome-overlay__ripple-ring {
  border: 2px solid rgba(255, 245, 235, 0.70);   /* warm cream — softer than pure white */
  background: radial-gradient(circle at center,
    color-mix(in srgb, var(--accent, #ff5722) 5%, transparent) 0%,
    rgba(255, 255, 255, 0.06) 45%,
    rgba(255, 255, 255, 0.02) 75%,
    transparent 100%);
  /* Outer halo carries the accent-orange warmth (intensity tunable via --ripple-tint); inner glow stays white-wet */
  box-shadow:
    0 0 32px 6px color-mix(in srgb, var(--accent, #ff5722) var(--ripple-tint, 20%), transparent),
    0 0 14px 2px rgba(255, 255, 255, 0.22),
    inset 0 0 14px rgba(255, 255, 255, 0.14);
  filter: blur(0.5px);
  opacity: 0;
}

/* Ring-count gating — hide trailing rings when the user picks fewer */
.welcome-overlay__ripple[data-rings="3"] .welcome-overlay__ripple-ring:nth-child(n+4),
.welcome-overlay__ripple[data-rings="4"] .welcome-overlay__ripple-ring:nth-child(n+5) {
  display: none;
}

/* Final fill — solid bg color sweeping out at the end → reveals welcome text */
.welcome-overlay__ripple-fill {
  background: var(--color-bg);
  opacity: 0;
}

.welcome-overlay.is-active .welcome-overlay__ripple-ring:nth-child(1) {
  animation: water-ring calc(var(--ripple-speed, 1.8) * 1.75s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0s;
}
.welcome-overlay.is-active .welcome-overlay__ripple-ring:nth-child(2) {
  animation: water-ring calc(var(--ripple-speed, 1.8) * 1.95s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--ripple-speed, 1.8) * 0.13s);
  border-color: rgba(255, 240, 225, 0.45);
}
.welcome-overlay.is-active .welcome-overlay__ripple-ring:nth-child(3) {
  animation: water-ring calc(var(--ripple-speed, 1.8) * 2.15s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--ripple-speed, 1.8) * 0.28s);
  border-color: rgba(255, 235, 215, 0.28);
}
.welcome-overlay.is-active .welcome-overlay__ripple-ring:nth-child(4) {
  animation: water-ring calc(var(--ripple-speed, 1.8) * 2.35s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--ripple-speed, 1.8) * 0.45s);
  border-color: rgba(255, 230, 210, 0.16);
}
.welcome-overlay.is-active .welcome-overlay__ripple-ring:nth-child(5) {
  animation: water-ring calc(var(--ripple-speed, 1.8) * 2.55s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--ripple-speed, 1.8) * 0.65s);
  border-color: rgba(255, 225, 205, 0.10);
}
.welcome-overlay.is-active .welcome-overlay__ripple-fill {
  animation: water-fill calc(var(--ripple-speed, 1.8) * 1.40s) cubic-bezier(0.5, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--ripple-speed, 1.8) * 0.55s);
}

@keyframes water-ring {
  0%   {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    border-width: 4px;
  }
  10%  {
    opacity: 1;
    border-width: 4px;
  }
  60%  {
    opacity: 0.7;
    border-width: 1.4px;
  }
  100% {
    transform: translate(-50%, -50%) scale(180);
    opacity: 0;
    border-width: 0.6px;
  }
}

@keyframes water-fill {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(220); opacity: 1; }
}

.welcome-overlay__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.0rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease calc(var(--ripple-speed, 1.8) * 1.85s), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--ripple-speed, 1.8) * 1.85s);
  padding: 0 2rem;
  z-index: 2;
}

.welcome-overlay.is-active .welcome-overlay__text {
  opacity: 1;
  transform: translateY(0);
}

/* When a letter animation is active, the letter spans handle the entrance —
   so the parent fades in fast with no translate shift to avoid double-motion. */
.welcome-overlay.has-letterfx .welcome-overlay__text {
  transform: none;
  transition: opacity 0.35s ease calc(var(--ripple-speed, 1.8) * 1.4s);
}
.welcome-overlay.has-letterfx.is-active .welcome-overlay__text {
  transform: none;
}

.welcome-overlay__greet {
  font-family: var(--mono-font);
  font-size: clamp(0.72rem, 1.2vw, 0.92rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #888;
}

.welcome-overlay__brand {
  font-family: var(--display-font);
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 400; /* Boldonse is already a single very-bold weight */
  letter-spacing: var(--welcome-brand-ls, -0.02em);
  line-height: var(--welcome-brand-lh, 0.95);
  color: #fff;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  text-transform: uppercase;
}
/* When letter effect is active, charming-split spans need normal block flow + visible whitespace */
.welcome-overlay__brand.is-letterfx {
  display: inline-block;
  gap: 0;
  white-space: normal;
}
.welcome-overlay__brand.is-letterfx > span { display: inline-block; }
.welcome-overlay__brand.is-letterfx .welcome-overlay__bang { color: var(--accent); }

.welcome-overlay__bang { color: var(--accent); }

.welcome-overlay__sub {
  font-family: var(--mono-font);
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #aaa;
  margin-top: 0.4rem;
}

.welcome-overlay__actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-overlay__back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin: 0.9rem auto 0;
  padding: 0.4rem 0.8rem;
  background: none; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transition: color 0.2s ease, transform 0.2s ease;
}
.welcome-overlay__back:hover { color: #fff; transform: translateY(-1px); }
.welcome-overlay__back svg { transition: transform 0.2s ease; }
.welcome-overlay__back:hover svg { transform: translateX(-3px); }

.projects__back {
  position: absolute; top: 1.5rem; left: 1.5rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
  z-index: 10;
}
.projects__back:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.7);
  transform: translateX(-3px);
}
.projects__back svg { transition: transform 0.2s ease; }
.projects__back:hover svg { transform: translateX(-2px); }


/* === Scroll-down hint at bottom of welcome overlay === */
.welcome-overlay__scroll {
  position: absolute;
  left: 50%;
  bottom: 2.5rem;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: none; border: 0; cursor: pointer;
  padding: 0.4rem 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s ease, color 0.2s ease, transform 0.3s ease;
  z-index: 4;
}
.welcome-overlay__scroll:hover { color: #fff; }
.welcome-overlay.is-revealed .welcome-overlay__scroll {
  opacity: 1; visibility: visible;
  transition-delay: calc(var(--ripple-speed, 1.8) * 0.8s);
}
.welcome-overlay__scroll-label {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}
.welcome-overlay__scroll-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  animation: scroll-bob 2s ease-in-out infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(8px); opacity: 0.5; }
}

.welcome-overlay.is-scrolling-out {
  transform: translateY(-100vh);
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
  pointer-events: none;
}

/* Bidirectional fade/translate for the static welcome elements ("Welcome to"
   greet, "!" bang, sub-heading, action buttons, scroll arrow, back arrow).
   Transitions (not keyframe animations) so when `is-exiting` is removed on
   scroll-up, the same properties tween BACK to default — buttons fade in
   smoothly as the user reverses past the threshold. */
.welcome-overlay__greet,
.welcome-overlay__sub,
.welcome-overlay__actions,
.welcome-overlay__back,
.welcome-overlay__scroll {
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.welcome-overlay__bang {
  display: inline-block;
  transform-origin: 50% 70%;
  transition: opacity 0.6s cubic-bezier(0.5, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.5, 0, 0.2, 1);
}

.welcome-overlay.is-exiting .welcome-overlay__greet,
.welcome-overlay.is-exiting .welcome-overlay__sub {
  opacity: 0;
  transform: translateY(-14px);
}
.welcome-overlay.is-exiting .welcome-overlay__sub {
  transition-delay: 0.05s;
}
.welcome-overlay.is-exiting .welcome-overlay__bang {
  opacity: 0;
  transform: translateY(-44px) rotate(-22deg) scale(0.85);
  transition-delay: 0.08s;
}
/* Stagger the actions/back/scroll a touch so they sweep up after the title */
.welcome-overlay.is-exiting .welcome-overlay__actions,
.welcome-overlay.is-exiting .welcome-overlay__back,
.welcome-overlay.is-exiting .welcome-overlay__scroll {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}
.welcome-overlay.is-exiting .welcome-overlay__actions { transition-delay: 0.10s; }
.welcome-overlay.is-exiting .welcome-overlay__back    { transition-delay: 0.14s; }
.welcome-overlay.is-exiting .welcome-overlay__scroll  { transition-delay: 0.06s; }

/* Tiny entrance for the "!" so it doesn't snap in when letter-FX is on
   (the letters animate per-character, the bang otherwise just appears).
   This keyframe runs ONCE on cube click; afterwards transitions take over. */
.welcome-overlay.has-letterfx.is-active .welcome-overlay__bang {
  animation: welcome-bang-in 0.65s cubic-bezier(0.2, 1.3, 0.4, 1) calc(var(--ripple-speed, 1.8) * 1.55s) backwards;
}
@keyframes welcome-bang-in {
  0%   { opacity: 0; transform: translateY(28px) rotate(-18deg) scale(0.6); }
  60%  { opacity: 1; transform: translateY(-4px) rotate(8deg) scale(1.12); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

/* About-section back button — sits LOWER (below the JAX STUDIO brand) so it
   doesn't visually collide with the top-left frame title. */
.about .projects__back { top: 5.6rem; left: 2.6rem; }
@media (max-width: 720px) { .about .projects__back { top: 5rem; left: 1.4rem; } }

/* === About section — flows in document below welcome (margin-top: 100vh).
   Welcome overlay stays `position: fixed`; About scrolls UP over it as the
   user wheels down. Solid background fully covers the cube — no flash.
   Letter FX exit/entrance fires on scroll-threshold crossings (hybrid). */
.about {
  position: relative;
  z-index: 70; /* above welcome (50) and cube */
  background: var(--color-bg);
  padding: 7rem 1.5rem 6rem;
  min-height: 100vh;
  margin-top: 100vh; /* sits below the fixed-welcome viewport */
  display: none;
}
.about.is-active { display: block; }
html.is-scrollable,
body.is-scrollable {
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  height: auto !important;
  min-height: 100%;
  scroll-behavior: smooth;
}
body.is-scrollable main {
  overflow: visible;
  height: auto;
  min-height: 100vh;
}
body.is-scrollable .hint { opacity: 0 !important; pointer-events: none; visibility: hidden; }
body.is-scrollable .frame__tagline { opacity: 0 !important; pointer-events: none; }
body.is-scrollable .content { touch-action: auto; }
.projects {
  position: relative;
  z-index: 5;
  background: var(--color-bg);
  padding: 8rem 1.5rem 6rem;
  min-height: 100vh;
  display: none;
}
.projects.is-active {
  display: block;
}
.projects__head {
  max-width: 960px;
  margin: 0 auto 4rem;
  text-align: left;
}
.projects__eyebrow {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  display: block; margin-bottom: 1rem;
}
.projects__title {
  font-family: var(--display-font);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  margin: 0 0 1.5rem 0;
  color: #fff;
}
.projects__lede {
  font-family: var(--ui-font);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 640px;
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  perspective: 1100px;
}
@media (min-width: 1100px) {
  .projects__grid { grid-template-columns: repeat(3, 1fr); }
}
.projects__empty {
  text-align: center; color: rgba(255, 255, 255, 0.4);
  font-family: var(--mono-font); font-size: 0.85rem;
  margin: 4rem auto;
}
.project-card {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  will-change: transform;
}
.project-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5),
              0 0 50px -10px color-mix(in srgb, var(--accent, #ff5722) 40%, transparent);
}
.project-card__image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #ff5722) 18%, #1a1a1c), #1a1a1c 60%, rgba(0, 0, 0, 0.4));
  overflow: hidden;
  transform: translateZ(0);
}
.project-card__image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.4s ease;
}
.project-card__placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--display-font); font-size: 4rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: -0.03em;
  user-select: none;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.project-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.4rem 1.4rem 1.2rem 1.4rem;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}
.project-card:hover .project-card__overlay { opacity: 1; }
.project-card__title {
  font-family: var(--display-font);
  font-size: 1.4rem; font-weight: 400; line-height: 1.05; letter-spacing: -0.01em;
  color: #fff; margin: 0 0 0.35rem 0;
  transform: translateY(8px); opacity: 0;
  transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1) 0.05s, opacity 0.4s ease 0.05s;
}
.project-card__year {
  font-family: var(--mono-font);
  font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent, #ff5722);
  margin: 0 0 0.6rem 0;
}
.project-card__desc {
  font-family: var(--ui-font);
  font-size: 0.78rem; line-height: 1.5; color: rgba(255, 255, 255, 0.78);
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  transform: translateY(8px); opacity: 0;
  transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1) 0.12s, opacity 0.4s ease 0.12s;
}
.project-card:hover .project-card__title,
.project-card:hover .project-card__desc { transform: translateY(0); opacity: 1; }

/* === About section === */
.about {
  position: relative;
  z-index: 70;
  background: var(--color-bg);
  padding: 7rem 1.5rem 6rem;
  min-height: 100vh;
  margin-top: 100vh;
  display: none;
}
.about.is-active { display: block; }

/* Welcome overlay no longer fades during about transition — it stays opaque
   so the cube behind never flashes. Letters are animated by playAboutExit/
   Entrance instead. (The is-faded class is kept for backwards-compat but no
   longer applied by the new hybrid scroll flow.) */
.about__inner { max-width: 1280px; margin: 0 auto; }
.about__head { margin-bottom: 4rem; max-width: 980px; }
.about__eyebrow {
  font-family: var(--mono-font); font-size: 0.75rem;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); display: block; margin-bottom: 1rem;
}
.about__title {
  font-family: var(--display-font); font-size: clamp(2rem, 5vw, 3.7rem);
  font-weight: 400; line-height: 1.05; margin: 0; color: #fff;
  letter-spacing: -0.01em;
}
.about__title-pre { color: #fff; display: inline; }
.about__title-emphasis { color: var(--accent, #ff5722); display: inline; margin-left: 0.3em; }

.about__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 880px) {
  .about__columns { grid-template-columns: 360px 1fr; gap: 4rem; align-items: start; }
}
@media (min-width: 1100px) {
  .about__columns { grid-template-columns: 380px 1fr; gap: 5rem; }
}

.about__photo {
  position: sticky;
  top: 6rem;
  display: flex; flex-direction: column; gap: 1.4rem;
}
.about__photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent, #ff5722) 30%, #1a1a1c),
    #1a1a1c 60%);
  box-shadow:
    0 30px 70px -20px rgba(0,0,0,0.6),
    0 0 60px -10px color-mix(in srgb, var(--accent, #ff5722) 20%, transparent);
}
.about__photo-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  position: relative; z-index: 1;
}
.about__photo-frame img:not([src]),
.about__photo-frame img[src=""] { display: none; }
.about__photo-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display-font);
  font-size: 6rem; font-weight: 400; color: rgba(255,255,255,0.45);
  letter-spacing: -0.04em; text-transform: uppercase;
  user-select: none;
}
.about__photo-frame.has-image .about__photo-fallback { display: none; }
.about__person {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding-left: 0.2rem;
}
.about__person-name {
  font-family: var(--display-font); font-size: 1.5rem; font-weight: 400;
  color: #fff; margin: 0; line-height: 1.1; letter-spacing: -0.01em;
}
.about__person-role {
  font-family: var(--ui-font); font-size: 0.85rem;
  color: rgba(255,255,255,0.6); margin: 0;
}
.about__years {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--accent, #ff5722);
  font-family: var(--mono-font);
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  width: fit-content;
}

.about__content {
  display: flex; flex-direction: column; gap: 3rem;
}
.about__body {
  display: flex; flex-direction: column; gap: 1.4rem;
}
.about__body p {
  font-family: var(--ui-font);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}
.about__subtitle {
  font-family: var(--mono-font); font-size: 0.7rem;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0 0 1.4rem 0;
}

.about__skills-list {
  display: flex; flex-direction: column; gap: 1rem;
}
.about-skill {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.about-skill__head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.about-skill__name {
  font-family: var(--ui-font); font-size: 0.95rem; font-weight: 600;
  color: #fff; letter-spacing: -0.005em;
}
.about-skill__pct {
  font-family: var(--mono-font); font-size: 0.7rem;
  color: var(--accent, #ff5722); letter-spacing: 0.1em;
}
.about-skill__bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.about-skill__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #ff5722), color-mix(in srgb, var(--accent, #ff5722) 50%, #fff));
  border-radius: 999px;
  width: 0%;
  transition: width 1.4s cubic-bezier(0.2, 1, 0.3, 1) 0.1s;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, #ff5722) 40%, transparent);
}
.about.is-active .about-skill__fill { width: var(--pct, 0%); }

.about__tools-list {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
}
.about-tool {
  display: inline-flex; align-items: center;
  padding: 0.55rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  cursor: default;
}
.about-tool:hover {
  background: rgba(255,87,34,0.08);
  border-color: rgba(255,87,34,0.4);
  color: var(--accent, #ff5722);
  transform: translateY(-2px);
}

/* When about/projects active also hide the floating header brand line so it stays clean */
body.is-scrollable .frame__brand,
body.is-scrollable .frame__contact,
body.is-scrollable .frame__admin { z-index: 50; }

/* === Admin checkbox row === */
.admin-checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem;
}
.admin-checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent, #ff5722);
  cursor: pointer;
  margin: 0;
}
.admin-checkbox-row .contact-form__label {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

/* === Admin Page 4 — projects list === */
.admin-projects { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }
.admin-project-row {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}
.admin-project-row__head {
  display: flex; gap: 0.6rem; align-items: center;
}
.admin-project-row__thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent, #ff5722), #1a1a1c);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display-font); color: rgba(255, 255, 255, 0.7);
  font-size: 1.3rem;
  background-size: cover; background-position: center;
}
.admin-project-row__heading { flex: 1; min-width: 0; }
.admin-project-row__title-input {
  width: 100%; background: transparent; border: 0; color: #fff;
  font-family: var(--ui-font); font-size: 0.85rem; font-weight: 600;
  padding: 0; margin: 0; outline: none;
  border-bottom: 1px solid transparent;
}
.admin-project-row__title-input:focus { border-bottom-color: var(--accent, #ff5722); }
.admin-project-row__meta { display: flex; gap: 0.4rem; }
.admin-project-row__meta input {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; color: #fff;
  font-family: var(--mono-font); font-size: 0.7rem;
  padding: 4px 8px; outline: none;
}
.admin-project-row__meta input:focus { border-color: var(--accent, #ff5722); }
.admin-project-row__meta-year { width: 70px; }
.admin-project-row__meta-order { width: 56px; }
.admin-project-row__desc {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  font-family: var(--ui-font); font-size: 0.75rem;
  padding: 8px; outline: none;
  resize: vertical; min-height: 60px;
}
.admin-project-row__desc:focus { border-color: var(--accent, #ff5722); }
.admin-project-row__actions { display: flex; gap: 0.4rem; }
.admin-project-row__actions button,
.admin-project-row__actions label.upload {
  font-family: var(--mono-font); font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: #ccc; cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
  flex: 1; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0;
}
.admin-project-row__actions button:hover,
.admin-project-row__actions label.upload:hover {
  background: rgba(255, 255, 255, 0.06); color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.admin-project-row__actions .is-save { border-color: rgba(255, 87, 34, 0.4); color: var(--accent, #ff5722); }
.admin-project-row__actions .is-save:hover { background: rgba(255, 87, 34, 0.12); }
.admin-project-row__actions .is-delete:hover { color: #ff8b8b; border-color: rgba(255, 80, 80, 0.4); background: rgba(255, 80, 80, 0.08); }
.admin-projects__empty {
  font-family: var(--mono-font); font-size: 0.7rem;
  color: rgba(255,255,255,0.4); text-align: center; padding: 1.2rem 0;
}


/* -------- Contact modal -------- */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.contact-modal.is-active {
  visibility: visible;
  opacity: 1;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.contact-modal__panel {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.6rem 2.4rem 2.2rem;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,87,34,0.08) inset;
}

.contact-modal.is-active .contact-modal__panel {
  transform: translateY(0) scale(1);
}

.contact-modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: #aaa;
  font-size: 1.3rem;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.contact-modal__close:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.contact-modal__eyebrow {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 1.2rem;
}

.contact-modal__title {
  font-family: var(--display-font);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 0.9rem 0;
  text-transform: uppercase;
}

.contact-modal__title em {
  font-style: normal;
  color: var(--accent);
}

.contact-modal__sub {
  font-family: var(--ui-font);
  font-size: 0.95rem;
  color: #aaa;
  margin: 0 0 1.8rem 0;
  letter-spacing: 0.01em;
}

/* -------- Contact form -------- */
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-form[hidden] { display: none; }
.contact-form__success[hidden] { display: none; }

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

@media (max-width: 540px) {
  .contact-form__row { grid-template-columns: 1fr; }
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form__label {
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #888;
}

.contact-form__field input,
.contact-form__field textarea {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.95rem 1rem;
  color: #fff;
  font-family: var(--ui-font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
  min-height: 0;
}

.contact-form__field textarea {
  min-height: 130px;
  font-family: var(--ui-font);
  line-height: 1.55;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
  border-color: var(--accent);
  background: #0d0d0d;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.contact-form__field input::placeholder,
.contact-form__field textarea::placeholder {
  color: #555;
}

.contact-form__field input:invalid:not(:placeholder-shown),
.contact-form__field textarea:invalid:not(:placeholder-shown) {
  border-color: rgba(255,80,80,0.5);
}

.contact-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.contact-form__hint {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #777;
}

.contact-form__hint a { color: #ddd; border-bottom: 1px solid var(--line-strong); }
.contact-form__hint a:hover { color: var(--accent); border-color: var(--accent); }

.contact-form__submit { position: relative; min-width: 180px; justify-content: center; }
.contact-form__submit[disabled] { opacity: 0.6; cursor: progress; }
.contact-form__submit-arrow { transition: transform 0.25s ease; }
.contact-form__submit:hover .contact-form__submit-arrow { transform: translateX(3px); }

.contact-form__status {
  font-family: var(--mono-font);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #ff8a65;
  min-height: 1em;
}

/* honeypot */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success state */
.contact-form__success {
  text-align: center;
  padding: 1rem 0;
}

.contact-form__success-mark {
  width: 64px;
  height: 64px;
  margin: 0.5rem auto 1.2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  border: 1px solid var(--accent);
  animation: pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.contact-form__success h3 {
  font-family: var(--display-font);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 0.6rem 0;
  color: #fff;
}

.contact-form__success p {
  color: #aaa;
  font-size: 0.95rem;
  margin: 0 0 1.6rem 0;
  line-height: 1.55;
}

/* -------- Mobile -------- */
@media (max-width: 640px) {
  .frame { padding: 1.2rem 1.2rem; }
  .frame__title { font-size: 0.78rem; letter-spacing: 0.28em; }
  .frame__tagline { font-size: 0.62rem; letter-spacing: 0.28em; }
  .frame__contact-btn { font-size: 0.62rem; padding: 0.55rem 0.95rem 0.55rem 0.75rem; letter-spacing: 0.22em; }
  .hint { bottom: 1.4rem; font-size: 0.6rem; letter-spacing: 0.32em; }
  .contact-modal__panel { padding: 2rem 1.4rem 1.6rem; border-radius: 14px; }
  .contact-modal__title { font-size: 1.9rem; }
  .admin-launcher { bottom: 1rem; left: 1rem; }
  .admin-panel { width: 100% !important; }
}

/* -------- Admin launcher (bottom-left) — Padlock-only collapsed; hover reveals "Admin" -------- */
.admin-launcher {
  position: fixed;
  bottom: 1.6rem;
  left: 1.6rem;
  z-index: 80; /* above welcome (50) + about (70) so it's visible throughout */
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  color: #aaa;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, padding 0.3s ease;
}
.admin-launcher__label {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
}

.admin-launcher:hover,
.admin-launcher:focus-visible {
  border-color: var(--line-strong);
  color: #fff;
  background: rgba(255,255,255,0.06);
  padding-right: 0.95rem;
}
.admin-launcher:hover .admin-launcher__label,
.admin-launcher:focus-visible .admin-launcher__label {
  max-width: 80px;
  opacity: 1;
}

.admin-launcher__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: inherit;
}

.admin-launcher.is-authed {
  border-color: var(--accent);
  color: var(--accent);
}

/* -------- Site Access bar (top of admin panel) -------- */
.admin-access-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.4rem;
  margin: 0;
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--line);
}
.admin-access-bar__copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.admin-access-bar__title {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #fff;
}
.admin-access-bar__sub {
  font-family: var(--mono-font);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: #888;
  text-transform: uppercase;
}
.admin-access-bar.is-locked .admin-access-bar__sub { color: var(--accent); }

/* iOS-style toggle switch */
.admin-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.admin-toggle__track {
  display: inline-block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #2a2a2c;
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.admin-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #888;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}
.admin-toggle__input:checked + .admin-toggle__track {
  background: var(--accent);
  border-color: var(--accent);
}
.admin-toggle__input:checked + .admin-toggle__track .admin-toggle__thumb {
  transform: translateX(18px);
  background: #fff;
}
.admin-toggle__input:focus-visible + .admin-toggle__track {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

/* -------- Admin login modal — reuse contact-modal styles but in its own scope -------- */
.admin-login {
  position: fixed; inset: 0; z-index: 110;
  display: flex; justify-content: center; align-items: center;
  padding: 1.5rem; visibility: hidden; opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.admin-login.is-active { visibility: visible; opacity: 1; }
.admin-login__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.admin-login__panel {
  position: relative;
  width: min(440px, 100%);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.4rem 2.2rem 1.8rem;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-soft) inset;
}
.admin-login.is-active .admin-login__panel { transform: translateY(0) scale(1); }
.admin-login__form { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.4rem; }

/* -------- Admin floating control panel -------- */
.admin-panel {
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  bottom: 1.2rem;
  width: 380px;
  max-width: calc(100vw - 2.4rem);
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line);
  border-radius: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(-100% - 2rem));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}
.admin-panel.is-active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.admin-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--line);
}

.admin-panel__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono-font);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #ddd;
}

.admin-panel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255,87,34,0.6);
  animation: pulse-dot 2.6s ease-in-out infinite;
}

.admin-panel__close {
  background: transparent;
  border: 1px solid var(--line);
  color: #aaa;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.admin-panel__close:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.04); }

.admin-panel__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.admin-panel__scroll::-webkit-scrollbar { width: 6px; }
.admin-panel__scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.admin-section {
  display: flex; flex-direction: column; gap: 0.7rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-section:last-child { border-bottom: 0; padding-bottom: 0; }

.admin-section__title {
  font-family: var(--ui-font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}
.admin-section__hint {
  font-family: var(--mono-font);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: #777;
  margin: -0.2rem 0 0.2rem 0;
}

/* === Admin Inbox === */
.admin-section__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
}
.admin-inbox__badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 7px;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: var(--accent, #ff5722);
  color: #0a0a0a;
  font-family: var(--mono-font);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
  vertical-align: 1px;
}
.admin-inbox__refresh {
  font-size: 0.95rem; line-height: 1;
  background: none; border: 0; cursor: pointer;
  color: rgba(255,255,255,0.45);
  padding: 4px 6px; border-radius: 6px;
  transition: color 160ms, background 160ms, transform 240ms;
}
.admin-inbox__refresh:hover { color: #fff; background: rgba(255,255,255,0.06); }
.admin-inbox__refresh.is-spinning { transform: rotate(360deg); }

.admin-inbox__list {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-height: 380px; overflow-y: auto;
  padding-right: 4px;
}
.admin-inbox__list::-webkit-scrollbar { width: 6px; }
.admin-inbox__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.admin-inbox__empty {
  font-family: var(--mono-font); font-size: 0.7rem; color: #555;
  margin: 0; padding: 0.8rem 0; text-align: center;
}

.inbox-item {
  position: relative;
  padding: 0.7rem 0.8rem 0.75rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.015);
  cursor: pointer;
  transition: border-color 160ms, background 160ms;
}
.inbox-item:hover { border-color: rgba(255,255,255,0.16); background: rgba(255,255,255,0.035); }
.inbox-item.is-unread { background: rgba(255,87,34,0.06); border-color: rgba(255,87,34,0.28); }
.inbox-item.is-unread::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 2px; border-radius: 2px;
  background: var(--accent, #ff5722);
}
.inbox-item__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
}
.inbox-item__name {
  font-family: var(--ui-font); font-size: 0.86rem; font-weight: 600; color: #fff;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-item__time {
  font-family: var(--mono-font); font-size: 0.6rem; letter-spacing: 0.06em; color: #666;
  white-space: nowrap; flex-shrink: 0;
}
.inbox-item__email {
  font-family: var(--mono-font); font-size: 0.66rem; color: #888;
  margin: 2px 0 6px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-item__snippet {
  font-family: var(--ui-font); font-size: 0.78rem; color: #b8b8b8;
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.inbox-item__events {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 8px;
}
.inbox-event {
  font-family: var(--mono-font); font-size: 0.56rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.05); color: #888;
  border: 1px solid rgba(255,255,255,0.06);
}
.inbox-event.is-delivered { background: rgba(80,200,120,0.08); color: #6ee787; border-color: rgba(80,200,120,0.25); }
.inbox-event.is-open      { background: rgba(80,140,255,0.10); color: #7ab2ff; border-color: rgba(80,140,255,0.30); }
.inbox-event.is-click     { background: rgba(180,120,255,0.10); color: #c19bff; border-color: rgba(180,120,255,0.30); }
.inbox-event.is-bounce,
.inbox-event.is-dropped,
.inbox-event.is-spamreport { background: rgba(255,80,80,0.10); color: #ff8b8b; border-color: rgba(255,80,80,0.30); }

.inbox-item.is-expanded {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.18);
  cursor: default;
}
.inbox-item__full {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.08);
  font-family: var(--ui-font); font-size: 0.82rem; color: #d9d9d9;
  line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}
.inbox-item__actions {
  display: flex; gap: 6px;
  margin-top: 10px;
}
.inbox-item__actions button {
  flex: 1;
  font-family: var(--mono-font); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02); color: #ccc;
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.inbox-item__actions button:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.2); }
.inbox-item__actions .is-reply { border-color: rgba(255,87,34,0.4); color: var(--accent, #ff5722); }
.inbox-item__actions .is-reply:hover { background: rgba(255,87,34,0.12); }
.inbox-item__actions .is-delete:hover { color: #ff8b8b; border-color: rgba(255,80,80,0.4); background: rgba(255,80,80,0.08); }

/* === Collapsible inbox === */
.admin-section--inbox .admin-section__head {
  cursor: pointer;
  user-select: none;
}
.admin-inbox__chevron {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  margin-left: auto;
  margin-right: 6px;
  color: rgba(255,255,255,0.5);
  transition: transform 240ms cubic-bezier(0.5, 0, 0.2, 1), color 160ms;
}
.admin-section--inbox .admin-section__head:hover .admin-inbox__chevron { color: #fff; }
.admin-section--inbox.is-collapsed .admin-inbox__chevron { transform: rotate(-90deg); }

.admin-inbox__body {
  display: flex; flex-direction: column; gap: 0.7rem;
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height 320ms cubic-bezier(0.5, 0, 0.2, 1), opacity 200ms 80ms, margin 320ms;
  margin-top: 0.2rem;
}
.admin-section--inbox.is-collapsed .admin-inbox__body {
  max-height: 0;
  opacity: 0;
  margin-top: -0.4rem;
  transition: max-height 280ms cubic-bezier(0.5, 0, 0.2, 1), opacity 120ms, margin 280ms;
}

/* === Multi-page panel === */
.admin-panel__page {
  display: none;
  flex-direction: column;
  gap: 1.1rem;
}
.admin-panel__page.is-active {
  display: flex;
  animation: panel-page-in 280ms cubic-bezier(0.5, 0, 0.2, 1);
}
@keyframes panel-page-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.admin-panel__pager {
  display: flex; align-items: center; justify-content: center;
  gap: 0.7rem;
  padding: 0.85rem 1.4rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.admin-pager__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms, transform 160ms;
}
.admin-pager__btn:hover:not(:disabled) {
  background: rgba(255,87,34,0.1);
  color: var(--accent, #ff5722);
  border-color: rgba(255,87,34,0.4);
  transform: scale(1.06);
}
.admin-pager__btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.admin-pager__indicator {
  font-family: var(--mono-font);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  min-width: 36px; text-align: center;
}
.admin-pager__page-label {
  font-family: var(--mono-font);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: 4px; text-align: center;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

/* compact inputs in the admin panel */
.admin-section .contact-form__field input,
.admin-section .contact-form__field textarea,
.admin-section .contact-form__field { gap: 0.3rem; }
.admin-section .contact-form__field input { padding: 0.7rem 0.85rem; font-size: 0.88rem; border-radius: 8px; }
.admin-section .contact-form__field textarea { padding: 0.65rem 0.85rem; font-size: 0.88rem; border-radius: 8px; min-height: 56px; resize: vertical; line-height: 1.35; font-family: var(--ui-font); }
.admin-section .contact-form__field textarea.admin-cube-text {
  font-family: var(--mono-font);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-font {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 0.55rem;
  align-items: stretch;
}
.admin-font__select {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  color: #fff;
  font-family: var(--ui-font);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.admin-font__select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.admin-font__select option { background: #0a0a0a; color: #fff; }
.admin-font__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
}

.admin-upload {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.admin-upload:hover { border-color: var(--accent); background: rgba(255,87,34,0.04); }
.admin-upload.is-uploaded { border-color: var(--accent); border-style: solid; background: rgba(255,87,34,0.04); }

.admin-upload__icon { color: #ccc; display: inline-flex; }
.admin-upload__copy { display: flex; flex-direction: column; gap: 0.1rem; }
.admin-upload__title { font-family: var(--ui-font); font-size: 0.85rem; font-weight: 600; color: #fff; }
.admin-upload__sub { font-family: var(--mono-font); font-size: 0.66rem; letter-spacing: 0.04em; color: #888; }
.admin-upload__progress { font-family: var(--mono-font); font-size: 0.7rem; color: #aaa; padding: 0.3rem 0.1rem; }

.admin-color {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  gap: 0.55rem 0.7rem;
  align-items: center;
}
.admin-color input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  grid-row: 1;
}
.admin-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.admin-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.admin-color input[type="text"] {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  color: #fff;
  font-family: var(--mono-font);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  outline: none;
  grid-row: 1;
  text-transform: uppercase;
}
.admin-color input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.admin-color__swatches {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-color__swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--c, #ff5722);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-color__swatch:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

/* Mini color picker pair (gradient color A/B) */
.admin-color--mini {
  display: grid;
  grid-template-columns: 36px 1fr 26px;
  grid-template-rows: auto auto;
  gap: 0.4rem 0.5rem;
  align-items: center;
}
.admin-color--mini .admin-color__label {
  grid-column: 1 / -1;
  margin: 0 0 -0.1rem 0;
}
.admin-color--mini input[type="color"] {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.admin-color--mini input[type="text"] {
  padding: 0.55rem 0.6rem;
  font-size: 0.76rem;
}
.admin-color__clear {
  background: transparent;
  border: 1px solid var(--line);
  color: #888;
  width: 26px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.admin-color__clear:hover { border-color: var(--accent); color: var(--accent); }

/* Sliders */
.admin-slider {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-slider__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-slider__label {
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #888;
}
.admin-slider__value {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.admin-slider__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.admin-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a0a0a;
  cursor: grab;
  transition: transform 0.15s ease;
}
.admin-slider__input:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.15); }
.admin-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a0a0a;
  cursor: grab;
}

/* Resizer (right edge of admin panel) */
.admin-panel__resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.admin-panel__resizer-grip {
  width: 3px;
  height: 48px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  transition: background 0.2s ease, height 0.2s ease;
}
.admin-panel__resizer:hover .admin-panel__resizer-grip,
.admin-panel.is-resizing .admin-panel__resizer-grip {
  background: var(--accent);
  height: 64px;
}
.admin-panel.is-resizing { transition: none; }
.admin-panel.is-resizing * { user-select: none !important; }

.admin-panel__footer {
  padding: 1rem 1.3rem 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-panel__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.admin-panel__row--secondary {
  grid-template-columns: 1fr 1fr;
}

.admin-panel__btn { width: 100%; justify-content: center; padding: 0.85rem 1rem; font-size: 0.7rem; }

.admin-panel__link {
  background: transparent;
  border: 0;
  color: #777;
  font-family: var(--mono-font);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  text-align: center;
}
.admin-panel__link:hover { color: #fff; }

.admin-panel__status {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  color: #aaa;
  min-height: 1em;
  text-align: center;
  letter-spacing: 0.04em;
}
.admin-panel__status.is-error { color: #ff8a65; }
.admin-panel__status.is-success { color: #4ade80; }
