/* ============================================================
   Design Token System
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* === Colors: Dark Mode (default) === */
  --bg:              #101014;
  --bg-subtle:       #16161c;
  --surface:         #1e1e26;
  --surface-hover:   #282832;
  --surface-elevated:#222230;

  --text-primary:    #ece8e0;
  --text-secondary:  #9a9494;
  --text-muted:      #64606a;

  --accent:          #d4a855;
  --accent-hover:    #e0bc72;
  --accent-muted:    rgba(212, 168, 85, 0.12);
  --accent-glow:     rgba(212, 168, 85, 0.22);

  --secondary:       #9b8ec4;
  --secondary-hover: #b0a5d4;
  --secondary-muted: rgba(155, 142, 196, 0.10);

  --border:          #2c2a36;
  --border-subtle:   #222028;

  --shadow-color:    rgba(0, 0, 0, 0.55);
  --shadow-accent:   rgba(212, 168, 85, 0.08);
  --shadow-teal:     rgba(155, 142, 196, 0.06);

  --overlay:         rgba(16, 16, 20, 0.90);

  /* === Typography === */
  --font-display:    'Space Grotesk', sans-serif;
  --font-body:       'Plus Jakarta Sans', sans-serif;

  --text-xs:         clamp(0.7rem, 0.65rem + 0.2vw, 0.78rem);
  --text-sm:         clamp(0.8rem, 0.75rem + 0.2vw, 0.88rem);
  --text-base:       clamp(0.92rem, 0.87rem + 0.25vw, 1.02rem);
  --text-lg:         clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  --text-xl:         clamp(1.25rem, 1.05rem + 1vw, 1.75rem);
  --text-2xl:        clamp(1.6rem, 1.3rem + 1.5vw, 2.3rem);
  --text-3xl:        clamp(2rem, 1.5rem + 2.5vw, 3.2rem);
  --text-hero:       clamp(2.2rem, 1.5rem + 3.5vw, 4rem);

  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.65;
  --leading-relaxed: 1.75;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.03em;
  --tracking-wider:  0.06em;

  /* === Spacing === */
  --space-2xs:       0.15rem;
  --space-xs:        0.25rem;
  --space-sm:        0.5rem;
  --space-md:        1rem;
  --space-lg:        1.5rem;
  --space-xl:        2rem;
  --space-2xl:       3rem;
  --space-3xl:       4rem;

  /* === Radii === */
  --radius-sm:       4px;
  --radius-md:       8px;
  --radius-lg:       12px;
  --radius-xl:       16px;
  --radius-pill:     100px;

  /* === Shadows === */
  --shadow-sm:       0 1px 3px var(--shadow-color);
  --shadow-md:       0 4px 12px var(--shadow-color), 0 1px 3px var(--shadow-accent);
  --shadow-lg:       0 8px 28px var(--shadow-color), 0 2px 6px var(--shadow-accent);
  --shadow-card:     0 2px 8px var(--shadow-color),
                     0 0 0 1px var(--border-subtle),
                     0 4px 16px var(--shadow-teal);
  --shadow-card-hover: 0 8px 24px var(--shadow-color),
                       0 0 0 1px var(--border),
                       0 4px 20px var(--shadow-accent);

  /* === Layout === */
  --sidebar-width:   200px;
  --content-padding: clamp(1rem, 2vw, 2rem);
  --max-prose:       65ch;
  --site-notice-height: 42px;

  /* === Transitions === */
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:     cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:        150ms;
  --dur-base:        250ms;
  --dur-slow:        400ms;
  --dur-panel:       500ms;
}

/* === Colors: Light Mode === */
[data-theme="light"] {
  --bg:              #f3f4f8;
  --bg-subtle:       #e6e8ee;
  --surface:         #ffffff;
  --surface-hover:   #f7f8fc;
  --surface-elevated:#ffffff;

  --text-primary:    #141620;
  --text-secondary:  #363a4a;
  --text-muted:      #606474;

  --accent:          #2e5cb8;
  --accent-hover:    #204ca8;
  --accent-muted:    rgba(46, 92, 184, 0.12);
  --accent-glow:     rgba(46, 92, 184, 0.25);

  --secondary:       #c48420;
  --secondary-hover: #a87018;
  --secondary-muted: rgba(196, 132, 32, 0.12);

  --border:          #c8cad4;
  --border-subtle:   #d6d8e0;

  --shadow-color:    rgba(20, 22, 32, 0.12);
  --shadow-accent:   rgba(46, 92, 184, 0.10);
  --shadow-teal:     rgba(196, 132, 32, 0.06);

  --overlay:         rgba(243, 244, 248, 0.94);

  --shadow-card:     0 2px 10px var(--shadow-color),
                     0 0 0 1px var(--border-subtle);
  --shadow-card-hover: 0 8px 28px var(--shadow-color),
                       0 0 0 1px var(--accent-muted),
                       0 4px 20px var(--shadow-accent);
}


/* ============================================================
   RESET
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-slow) var(--ease-in-out),
              color var(--dur-slow) var(--ease-in-out);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

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

/* Skip link */
.skip-link {
  position: fixed;
  top: 0;
  left: var(--space-md);
  z-index: 9999;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transform: translateY(-100%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  min-height: var(--site-notice-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-lg);
  background: linear-gradient(120deg, var(--accent-muted), var(--bg-subtle));
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.site-notice[hidden] {
  display: none;
}

.site-notice__text {
  width: min(100%, 1200px);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.site-notice-lockdown {
  overflow: hidden;
}

body.site-notice-lockdown .skip-link,
body.site-notice-lockdown .mobile-menu,
body.site-notice-lockdown .sidebar,
body.site-notice-lockdown .content,
body.site-notice-lockdown .site-footer {
  display: none !important;
}

body.site-notice-lockdown .mobile-header {
  top: 0;
  z-index: 140;
  justify-content: flex-end;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.site-notice-lockdown.site-notice-active .mobile-header {
  top: 0;
}

body.site-notice-lockdown .mobile-header__name,
body.site-notice-lockdown .menu-toggle {
  display: none;
}

body.site-notice-lockdown .site-notice {
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(4.6rem, 11vh, 6.8rem) clamp(1.5rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem);
  border-bottom: none;
  box-shadow: none;
  background: var(--bg);
}

body.site-notice-lockdown .site-notice__text {
  width: min(92vw, 940px);
  font-size: clamp(1.25rem, 1rem + 2vw, 2.2rem);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  white-space: normal;
  text-wrap: balance;
}

body.edit-route-bootstrap {
  overflow: hidden;
}

body.app-booting {
  overflow: hidden;
}

body.app-booting:not(.edit-route-bootstrap) .mobile-header,
body.app-booting:not(.edit-route-bootstrap) .topbar,
body.app-booting .skip-link,
body.app-booting .site-notice,
body.app-booting .mobile-menu,
body.app-booting .sidebar,
body.app-booting .content,
body.app-booting .site-footer,
body.app-booting .editor-toolbar {
  display: none !important;
}

body.edit-route-bootstrap .skip-link,
body.edit-route-bootstrap .site-notice,
body.edit-route-bootstrap .mobile-menu,
body.edit-route-bootstrap .sidebar,
body.edit-route-bootstrap .content,
body.edit-route-bootstrap .site-footer,
body.edit-route-bootstrap .editor-toolbar {
  display: none !important;
}

body.edit-route-bootstrap .mobile-header {
  top: 0;
  z-index: 340;
  justify-content: flex-end;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.edit-route-bootstrap .mobile-header__name,
body.edit-route-bootstrap .menu-toggle {
  display: none;
}

body.app-booting.edit-route-bootstrap .lang-dropdown {
  display: none;
}


body.edit-route-bootstrap .topbar {
  z-index: 340;
}

/* ── Page Loader ────────────────────────────────── */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}

.page-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.page-loader__ring {
  width: 36px;
  height: 36px;
  border: 2.5px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.page-loader__text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: lowercase;
  color: var(--text-muted);
}

/* ── Entrance animations ────────────────────────── */

.sidebar,
.mobile-header,
.topbar,
.site-footer {
  animation: entrance-fade 0.5s var(--ease-out) both;
}

.content {
  animation: entrance-up 0.6s var(--ease-out) 0.1s both;
}

@keyframes entrance-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes entrance-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   MOBILE HEADER
   Visible below 1024px
   ============================================================ */

.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-slow) var(--ease-in-out),
              border-color var(--dur-slow) var(--ease-in-out);
}

body.site-notice-active .mobile-header {
  top: var(--site-notice-height);
}

.mobile-header__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.mobile-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Menu toggle (3-bar hamburger) */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out);
}

.menu-toggle:hover {
  background: var(--accent-muted);
}

.menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.menu-toggle:hover .menu-toggle__bar {
  background: var(--accent);
}

/* Open: bars form X */
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   MOBILE MENU OVERLAY
   ============================================================ */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-slow) var(--ease-out),
              visibility var(--dur-slow);
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: var(--tracking-tight);
  transition: color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  position: relative;
}

.mobile-menu__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out);
}

.mobile-menu__link.active,
.mobile-menu__link:hover {
  color: var(--text-primary);
}

.mobile-menu__link.active::after {
  transform: translateX(-50%) scaleX(1);
}


/* ============================================================
   DESKTOP SIDEBAR
   Visible at 1024px+
   ============================================================ */

.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: var(--space-2xl) var(--space-lg) var(--space-lg);
    background: var(--bg-subtle);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 1px 0 12px var(--shadow-color);
    transition: background var(--dur-slow) var(--ease-in-out),
                border-color var(--dur-slow) var(--ease-in-out);
  }

  .mobile-header {
    display: none;
  }
}

.sidebar__brand {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.sidebar__role {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-top: var(--space-xs);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-md);
  transition: color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.sidebar__link:hover {
  color: var(--text-primary);
  background: var(--accent-muted);
}

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

.sidebar__link-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}

.sidebar__link.active .sidebar__link-dot {
  opacity: 1;
  transform: scale(1);
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.sidebar__icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.sidebar__social {
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-out);
  display: flex;
  align-items: center;
}

.sidebar__social:hover {
  color: var(--text-primary);
}

.sidebar__divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

.sidebar__copyright {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}


/* ============================================================
   THEME TOGGLE
   ============================================================ */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--accent-muted);
}

/* Show sun in dark mode, moon in light mode */
[data-theme="dark"] .theme-icon--sun  { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }
[data-theme="light"] .theme-icon--sun  { display: none; }
[data-theme="light"] .theme-icon--moon { display: block; }


/* ============================================================
   DESKTOP TOPBAR (theme + language, top-right)
   ============================================================ */

.topbar {
  display: none;
}

@media (min-width: 1024px) {
  .topbar {
    position: fixed;
    top: var(--space-md);
    right: var(--space-lg);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
  }
}


/* ============================================================
   LANGUAGE DROPDOWN
   ============================================================ */

.lang-dropdown {
  position: relative;
}

.lang-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.lang-dropdown__trigger:hover {
  color: var(--text-primary);
  background: var(--accent-muted);
}

.lang-dropdown__trigger[disabled],
.lang-dropdown__trigger[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.lang-dropdown__trigger[disabled]:hover,
.lang-dropdown__trigger[aria-disabled="true"]:hover {
  color: var(--text-muted);
  background: transparent;
}

.lang-dropdown__current {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}

.lang-dropdown__chevron {
  transition: transform var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}

.lang-dropdown__trigger[aria-expanded="true"] .lang-dropdown__chevron {
  transform: rotate(180deg);
}

.lang-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast) var(--ease-out),
              visibility var(--dur-fast),
              transform var(--dur-fast) var(--ease-out);
  z-index: 200;
}

.lang-dropdown__menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown__item {
  display: block;
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.lang-dropdown__item[hidden] {
  display: none;
}

.lang-dropdown__item:hover {
  color: var(--text-primary);
  background: var(--accent-muted);
}

.lang-dropdown__item.active {
  color: var(--accent);
}


/* ============================================================
   MOBILE MENU FOOTER (GitHub + Resume inside overlay)
   ============================================================ */

.mobile-menu__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.mobile-menu__icon {
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-out);
  display: flex;
  align-items: center;
}

.mobile-menu__icon:hover {
  color: var(--text-primary);
}


/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.content {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 60px; /* space for mobile header */
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    var(--bg-subtle) 100%
  );
}

body.site-notice-active .content {
  padding-top: calc(60px + var(--site-notice-height));
}

@media (min-width: 1024px) {
  .content {
    margin-left: var(--sidebar-width);
    padding-top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
  }

  body.site-notice-active .sidebar {
    top: var(--site-notice-height);
  }

  body.site-notice-active .topbar {
    top: calc(var(--space-md) + var(--site-notice-height));
  }

  body.site-notice-lockdown .topbar {
    z-index: 140;
    top: var(--space-md);
  }

  body.site-notice-active .content {
    height: calc(100vh - var(--site-notice-height));
    height: calc(100dvh - var(--site-notice-height));
    padding-top: 0;
  }
}


/* ============================================================
   PANELS (Desktop: stacked, one visible at a time)
   ============================================================ */

.panel {
  padding: var(--content-padding);
}

@media (min-width: 1024px) {
  .panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-2xl) var(--content-padding);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--dur-panel) var(--ease-out),
                transform var(--dur-panel) var(--ease-out),
                visibility 0ms var(--dur-panel);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
  }

  .panel::-webkit-scrollbar {
    width: 4px;
  }

  .panel::-webkit-scrollbar-track {
    background: transparent;
  }

  .panel::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
  }

  .panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity var(--dur-panel) var(--ease-out),
                transform var(--dur-panel) var(--ease-out),
                visibility 0ms 0ms;
  }
}


/* Per-panel desktop overrides (ID specificity beats .panel class) */
@media (min-width: 1024px) {
  #projects {
    justify-content: center;
    align-items: center;
    padding: var(--space-lg) var(--content-padding);
  }

  #projects .section-title {
    width: 100%;
    max-width: 1100px;
  }

  #projects .projects-grid {
    max-width: 1100px;
    width: 100%;
  }

  #about {
    align-items: center;
  }

  #about .section-title {
    width: 100%;
    max-width: 860px;
  }

  #about .about-content {
    width: 100%;
    max-width: 860px;
  }

  #contact {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  #contact .contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 560px;
  }

  #contact .contact-secondary {
    justify-content: center;
  }
}

/* ============================================================
   SECTION TITLE
   ============================================================ */

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

@media (min-width: 1024px) {
  .section-title {
    margin-bottom: var(--space-xl);
  }
}


/* ============================================================
   HOME / HERO
   ============================================================ */

#home {
  position: relative;
  min-height: 80vh;
  min-height: 80dvh;
  display: flex;
  align-items: center;
}

@media (min-width: 1024px) {
  #home {
    min-height: unset;
    position: absolute;
    overflow: hidden;
  }
}

.hero {
  position: relative;
  max-width: 620px;
  padding: var(--space-xl) 0;
}

@media (min-width: 1024px) {
  .hero {
    max-width: 680px;
    padding: 0 var(--space-xl);
  }
}

@media (min-width: 1440px) {
  .hero {
    max-width: 720px;
    padding: 0 var(--space-2xl);
  }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 20px var(--shadow-color);
}

.hero__body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: var(--max-prose);
  margin-bottom: var(--space-xl);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: var(--tracking-wide);
  padding: var(--space-sm) 0;
  border-bottom: 2px solid var(--accent-muted);
  transition: border-color var(--dur-base) var(--ease-out),
              gap var(--dur-base) var(--ease-out);
}

.hero__cta:hover {
  border-color: var(--accent);
  gap: var(--space-md);
}

.hero__cta svg {
  transition: transform var(--dur-base) var(--ease-out);
}

.hero__cta:hover svg {
  transform: translateX(4px);
}


/* ============================================================
   PROJECTS GRID
   ============================================================ */

.projects-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

.projects-status {
  grid-column: 1 / -1;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-md) 0;
}

@media (min-width: 600px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
}


/* ============================================================
   PROJECT CARD
   ============================================================ */

.project-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-slow) var(--ease-in-out);
  position: relative;
  overflow: hidden;
}

/* Gradient border via two stacked pseudo-elements for smooth transition */
.project-card::before,
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

/* Default visible gradient border */
.project-card::before {
  background: linear-gradient(
    135deg,
    var(--accent-glow) 0%,
    var(--border) 35%,
    var(--border) 65%,
    var(--secondary-muted) 100%
  );
  opacity: 1;
}

/* Hover vivid gradient border (hidden by default) */
.project-card::after {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-hover) 25%,
    var(--secondary-hover) 75%,
    var(--secondary) 100%
  );
  opacity: 0;
}

.project-card:hover,
.project-card:focus-visible {
  box-shadow: var(--shadow-card-hover);
}

.project-card:hover::before,
.project-card:focus-visible::before {
  opacity: 0;
}

.project-card:hover::after,
.project-card:focus-visible::after {
  opacity: 1;
}

@media (min-width: 1024px) {
  .project-card {
    padding: clamp(0.9rem, 1.2vw, 1.3rem);
    gap: var(--space-xs);
  }
}

.project-card__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.project-card__subtitle {
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--secondary);
  line-height: var(--leading-snug);
}

.project-card__narrative {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__view-more {
  margin-top: 0.2rem;
  align-self: flex-start;
  border: none;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  background: transparent;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.project-card__view-more:hover {
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--accent-hover) 70%, transparent);
}

@media (min-width: 1024px) and (max-height: 800px) {
  .project-card__narrative {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}


/* ============================================================
   TECH TAGS
   ============================================================ */

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: auto;
  padding-top: var(--space-xs);
}

.project-card__tags:empty {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  color: var(--secondary);
  background: var(--secondary-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  line-height: 1.5;
}


.project-card:hover .tag,
.project-card:focus-visible .tag {
  border-color: var(--secondary-muted);
}

/* Alternate tag coloring for visual variety */
.tag:nth-child(even) {
  color: var(--accent);
  background: var(--accent-muted);
}

.project-card:hover .tag:nth-child(even),
.project-card:focus-visible .tag:nth-child(even) {
  border-color: var(--accent-muted);
}


/* ============================================================
   PROJECT LINKS
   ============================================================ */

.project-card__links {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-xs);
}

.project-card__links:empty {
  display: none;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.project-link:hover {
  color: var(--accent);
}

.project-link svg {
  flex-shrink: 0;
}


/* ============================================================
   PROJECT DETAILS MODAL
   ============================================================ */

html.project-modal-open,
body.project-modal-open {
  overflow: hidden;
}

.project-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.8rem, 1.8vw, 1.6rem);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  backdrop-filter: blur(7px);
}

.project-detail-modal {
  width: min(980px, 100%);
  max-height: calc(100dvh - clamp(1.6rem, 3vw, 2.8rem));
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 18px;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--surface) 85%, transparent) 0%,
    color-mix(in srgb, var(--surface-elevated) 92%, transparent) 100%
  );
  box-shadow: 0 28px 56px color-mix(in srgb, #060912 66%, transparent);
}

.project-detail-modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.75rem clamp(1rem, 2.2vw, 1.5rem);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: color-mix(in srgb, var(--bg-subtle) 96%, transparent);
  backdrop-filter: blur(10px);
}

.project-detail-modal__close {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-hover) 70%, transparent);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.project-detail-modal__close svg {
  display: block;
}

.project-detail-modal__close:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent-muted) 55%, var(--surface-hover));
}

.project-detail-modal__body {
  display: grid;
  gap: var(--space-md);
  padding: 1rem clamp(1rem, 2.2vw, 2.2rem) 1.4rem;
}

.project-detail-modal__description {
  margin: 0;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
}

.project-detail-gallery {
  display: grid;
  gap: 0.65rem;
}

.project-detail-gallery__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.project-detail-gallery__viewport {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-hover) 72%, transparent);
  touch-action: pan-y pinch-zoom;
}

.project-detail-gallery__track {
  display: flex;
  transition: transform var(--dur-base) var(--ease-out);
}

.project-detail-gallery__slide {
  border: none;
  flex: 0 0 100%;
  background: transparent;
  padding: 0;
}

.project-detail-gallery__slide img {
  display: block;
  width: 100%;
  max-height: min(52vh, 460px);
  object-fit: cover;
}

.project-detail-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
  opacity: 0.65;
  transition: opacity 200ms ease, background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.project-detail-gallery__arrow:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border-color: var(--border);
}

.project-detail-gallery__arrow--prev:hover {
  transform: translateY(-50%) translateX(-2px);
}

.project-detail-gallery__arrow--next:hover {
  transform: translateY(-50%) translateX(2px);
}

.project-detail-gallery__arrow svg {
  display: block;
}

.project-detail-gallery__arrow--prev {
  left: 0.5rem;
}

.project-detail-gallery__arrow--next {
  right: 0.5rem;
}

.project-detail-gallery__arrow[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.project-detail-gallery__arrow[disabled]:hover {
  opacity: 0.3;
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}

.project-detail-gallery__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-detail-gallery__counter {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-display);
}

.project-detail-gallery__dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.project-detail-gallery__dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: color-mix(in srgb, var(--text-muted) 52%, transparent);
  transition: background 200ms ease, transform 200ms ease;
  cursor: pointer;
}

.project-detail-gallery__dot:hover {
  background: color-mix(in srgb, var(--text-muted) 85%, transparent);
  transform: scale(1.3);
}

.project-detail-gallery__dot.active {
  background: var(--accent);
}

.project-detail-gallery__dot.active:hover {
  background: var(--accent);
}

.project-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(3, 6, 13, 0.9);
}

.project-image-lightbox__panel {
  width: min(1240px, 100%);
  max-height: calc(100dvh - 2rem);
  display: grid;
  place-items: center;
}

.project-image-lightbox__frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: calc(100dvh - 2rem);
}

.project-image-lightbox__frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 2rem);
  object-fit: contain;
  border-radius: 12px;
}

.project-image-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(8, 12, 22, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0.5;
  transition: opacity 200ms ease, color 200ms ease, background 200ms ease;
}

.project-image-lightbox__close:hover {
  opacity: 1;
  color: #fff;
  background: rgba(8, 12, 22, 0.72);
}

.project-image-lightbox__close svg {
  display: block;
}


/* ============================================================
   ABOUT SECTION
   ============================================================ */

#about {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-content {
  display: grid;
  gap: var(--space-2xl);
  max-width: 800px;
}

@media (min-width: 768px) {
  .about-content {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-3xl);
    align-items: start;
  }
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about-text p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: var(--max-prose);
}

.about-text p:first-child {
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: var(--leading-normal);
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.about-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.about-detail__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
}

.about-detail__value {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}


/* ============================================================
   CONTACT SECTION
   ============================================================ */

#contact {
  display: flex;
  align-items: center;
}

.contact-content {
  max-width: 520px;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-lg);
}

.contact-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: var(--max-prose);
  margin-bottom: var(--space-xl);
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent);
  padding: var(--space-md) var(--space-xl);
  background: var(--accent-muted);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-lg);
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              gap var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.contact-email:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  gap: var(--space-md);
  box-shadow: 0 0 24px var(--accent-glow);
}

.contact-email svg {
  transition: transform var(--dur-base) var(--ease-out);
}

.contact-email:hover svg {
  transform: translateX(4px);
}

.contact-secondary {
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-lg);
}

.contact-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle);
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.contact-link:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  padding: var(--space-lg) var(--space-lg);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
  border-top: 1px solid var(--border-subtle);
}

@media (min-width: 1024px) {
  .site-footer {
    display: none;
  }
}


/* ============================================================
   MOBILE SECTION SPACING
   ============================================================ */

@media (max-width: 1023px) {
  .panel {
    padding: var(--space-2xl) var(--space-lg);
    scroll-margin-top: 60px;
  }

  #home {
    padding-top: var(--space-3xl);
    min-height: calc(100vh - 60px);
    min-height: calc(100dvh - 60px);
  }

  #projects {
    padding-bottom: var(--space-2xl);
  }

  #about {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    min-height: auto;
  }

  #contact {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-3xl);
    min-height: 60vh;
    min-height: 60dvh;
  }
}


/* ============================================================
   SCROLL REVEAL ANIMATIONS (Mobile only)
   Elements fade/slide in as they enter the viewport
   ============================================================ */

@media (max-width: 1023px) {
  .project-card,
  .about-content,
  .contact-content {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-out),
                transform 0.6s var(--ease-out);
  }

  .project-card.revealed,
  .about-content.revealed,
  .contact-content.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger project cards */
  .project-card:nth-child(2) { transition-delay: 80ms; }
  .project-card:nth-child(3) { transition-delay: 160ms; }
  .project-card:nth-child(4) { transition-delay: 240ms; }
  .project-card:nth-child(5) { transition-delay: 320ms; }
  .project-card:nth-child(6) { transition-delay: 400ms; }
}


/* ============================================================
   RESPONSIVE FINE-TUNING
   ============================================================ */

/* Large desktops */
@media (min-width: 1440px) {
  :root {
    --sidebar-width: 240px;
    --content-padding: 3rem;
  }
}

/* Compact desktop: tighten projects */
@media (min-width: 1024px) and (max-height: 750px) {
  .project-card {
    padding: clamp(0.7rem, 1vw, 1rem);
    gap: 3px;
  }

  .section-title {
    margin-bottom: var(--space-md);
    font-size: var(--text-lg);
  }

  .projects-grid {
    gap: var(--space-sm);
  }

  .project-card__narrative {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: var(--text-xs);
  }

  .tag {
    padding: 2px 7px;
    font-size: 0.65rem;
  }
}

/* Very small screens */
@media (max-width: 374px) {
  .hero__headline {
    font-size: 1.8rem;
  }

  .contact-email {
    font-size: var(--text-base);
    padding: var(--space-sm) var(--space-md);
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

/* ============================================================
   INLINE EDITOR
   ============================================================ */

.editor-toolbar {
  position: fixed;
  right: clamp(0.6rem, 1vw, 1rem);
  bottom: clamp(0.6rem, 1.6vw, 1.2rem);
  z-index: 300;
  width: min(900px, calc(100vw - 1.2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.editor-toolbar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.editor-toolbar__status span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-toolbar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-muted) 22%, transparent);
  flex-shrink: 0;
}

.editor-toolbar__status--success .editor-toolbar__dot {
  background: #3ebc88;
  box-shadow: 0 0 0 3px color-mix(in srgb, #3ebc88 20%, transparent);
}

.editor-toolbar__status--error .editor-toolbar__dot {
  background: #de5f69;
  box-shadow: 0 0 0 3px color-mix(in srgb, #de5f69 20%, transparent);
}

.editor-toolbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.editor-toolbar__btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.32rem 0.58rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-hover) 75%, transparent);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.editor-toolbar__btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-muted) 58%, var(--surface-hover));
}

.editor-toolbar__btn--primary {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background: var(--accent);
}

.editor-toolbar__btn--primary:hover {
  color: #fff;
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

body.editor-mode .editor-editable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent-muted) 35%, transparent);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

body.editor-mode .editor-editable:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-hover) 82%, transparent),
              0 0 0 4px color-mix(in srgb, var(--accent-muted) 45%, transparent);
  background: color-mix(in srgb, var(--accent-muted) 65%, transparent);
}

.project-card--create {
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent-muted) 30%, var(--surface));
}

.editor-create-project {
  min-height: 210px;
  width: 100%;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-hover) 70%, transparent);
  transition: color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.editor-create-project:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--accent-muted) 50%, var(--surface-hover));
}

.editor-create-project__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: var(--accent);
}

.editor-create-project__icon svg {
  display: block;
}

.editor-create-project__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: var(--tracking-wide);
}

.editor-create-project__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.project-card--draft {
  opacity: 0.78;
}

.project-card--draggable {
  cursor: grab;
}

.project-card--draggable:active {
  cursor: grabbing;
}

.project-card--dragging {
  opacity: 0.58;
  transform: scale(0.992);
}

.project-card--drop-before {
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--accent) 85%, transparent);
}

.project-card--drop-after {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--accent) 85%, transparent);
}

.editor-draft-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: color-mix(in srgb, #d07e2f 75%, #000);
}

.editor-project-controls {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.editor-project-control {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius-md);
  padding: 0.22rem 0.4rem;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-hover) 85%, transparent);
  backdrop-filter: blur(6px);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.editor-project-control--icon {
  width: 1.5rem;
  padding: 0.22rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-project-control--icon svg {
  display: block;
}

.editor-project-control:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background: color-mix(in srgb, var(--accent-muted) 72%, var(--surface-hover));
}

.editor-project-control[disabled],
.editor-project-control[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.editor-project-control--danger {
  border-color: color-mix(in srgb, #d65f6a 38%, var(--border));
}

.editor-project-control--danger:hover {
  border-color: color-mix(in srgb, #d65f6a 80%, transparent);
  background: color-mix(in srgb, #d65f6a 20%, var(--surface-hover));
}

.projects-status--edit {
  color: var(--text-secondary);
}

html.editor-modal-open,
body.editor-modal-open {
  overflow: hidden;
}

.editor-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.85rem, 1.9vw, 1.6rem);
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(6px);
  animation: entrance-fade 0.3s var(--ease-out) both;
}

.editor-modal {
  width: min(1100px, 100%);
  max-height: calc(100dvh - clamp(1.7rem, 3.8vw, 3.2rem));
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-elevated));
  box-shadow: 0 24px 48px color-mix(in srgb, #060912 60%, transparent),
              0 0 0 1px var(--border-subtle);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 40%, transparent) transparent;
  animation: entrance-up 0.35s var(--ease-out) both;
}

.editor-modal-backdrop--gate {
  align-items: center;
  justify-content: center;
  padding: clamp(0.85rem, 1.9vw, 1.6rem);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
}

.editor-modal-backdrop--confirm {
  z-index: 360;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  backdrop-filter: blur(8px);
}

.editor-modal--gate {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  border-radius: var(--radius-xl);
}

.editor-modal--confirm {
  width: min(520px, 100%);
  max-height: none;
  overflow: visible;
}

.editor-modal--confirm .editor-modal__header {
  position: static;
  background: transparent;
  border-bottom-color: transparent;
  padding-bottom: 0;
}

.editor-modal--confirm .editor-modal__body {
  padding-top: 0.35rem;
}

.editor-modal--gate .editor-modal__body {
  width: 100%;
  margin: 0;
}

.editor-modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.75rem clamp(1rem, 2.2vw, 1.5rem);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: color-mix(in srgb, var(--bg-subtle) 96%, transparent);
  backdrop-filter: blur(10px);
}

.editor-modal__headline h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.editor-modal__headline p {
  margin: 0.32rem 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.editor-modal__close {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-hover) 70%, transparent);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.editor-modal__close svg {
  display: block;
}

.editor-modal__close:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent-muted) 55%, var(--surface-hover));
}

.editor-modal__body {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 2.2vw, 1.5rem) 1.25rem;
}

.editor-modal__message {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.editor-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.editor-form label span {
  color: color-mix(in srgb, var(--text-secondary) 92%, var(--text-muted));
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-required {
  margin-left: 0.2rem;
  color: var(--accent);
  font-weight: 700;
}

.editor-form input,
.editor-form textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.editor-form input::placeholder,
.editor-form textarea::placeholder,
.editor-inline-input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 70%, transparent);
}

.editor-form textarea {
  resize: vertical;
  min-height: 100px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 35%, transparent) transparent;
}

.editor-form input:focus,
.editor-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-muted) 65%, transparent);
  outline: none;
}

.editor-form input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.editor-form input[type='number']::-webkit-outer-spin-button,
.editor-form input[type='number']::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.editor-number-field {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-number-field input[name='sort_order'] {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
}

.editor-stepper {
  width: 30px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.editor-stepper__btn {
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 0;
  padding: 0;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.editor-stepper__btn:last-child {
  border-bottom: none;
}

.editor-stepper__btn:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent-muted) 65%, transparent);
}

.editor-form-row {
  display: grid;
  gap: 0.65rem;
}

.editor-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.editor-upload-picker {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.38rem 0.6rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-hover) 70%, transparent);
  overflow: hidden;
}

.editor-upload-picker:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
}

.editor-upload-picker span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: var(--leading-snug);
}

.editor-upload-picker input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.editor-form-help--upload {
  margin-top: -0.2rem;
}

.editor-form-help--upload[data-editor-upload-selection] {
  color: var(--text-secondary);
}

.editor-form-row--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-form-row--three {
  grid-template-columns: 1.5fr 0.6fr 0.7fr;
}

.editor-form-row--slug-urls {
  grid-template-columns: 1fr 2fr 2fr;
}

label.editor-checkbox {
  flex-direction: row;
  align-items: center;
  align-self: flex-start;
  gap: 0.55rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
}

label.editor-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

label.editor-checkbox .toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--text-muted) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  flex-shrink: 0;
  transition: background 200ms ease, border-color 200ms ease;
}

label.editor-checkbox .toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 200ms ease, background 200ms ease;
}

label.editor-checkbox input:checked + .toggle-track {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  border-color: var(--accent);
}

label.editor-checkbox input:checked + .toggle-track::after {
  transform: translateX(14px);
  background: #fff;
}

label.editor-checkbox:hover .toggle-track {
  border-color: color-mix(in srgb, var(--text-muted) 65%, transparent);
}

label.editor-checkbox:hover input:checked + .toggle-track {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 50%, transparent);
}

label.editor-checkbox span {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--text-secondary) 92%, var(--text-muted));
}

.editor-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.editor-lang-grid--single-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-lang-fieldset {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: var(--radius-lg);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: color-mix(in srgb, var(--surface-hover) 50%, transparent);
}

.editor-lang-fieldset legend {
  padding: 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.editor-form-help {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.editor-form-error {
  min-height: 1.3rem;
  margin: 0;
  color: color-mix(in srgb, #de5f69 95%, #fff 5%);
  font-size: 0.82rem;
}

.editor-error-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.32rem;
}

.editor-error-list li {
  padding: 0.4rem 0.55rem;
  border: 1px solid color-mix(in srgb, #de5f69 45%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, #de5f69 14%, transparent);
  font-size: var(--text-sm);
}

.editor-input-invalid {
  border-color: color-mix(in srgb, #de5f69 72%, transparent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, #de5f69 20%, transparent) !important;
}

.editor-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.editor-modal__actions--confirm {
  margin-top: 0.95rem;
}

.editor-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.38rem 0.62rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-hover) 75%, transparent);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.editor-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-muted) 55%, var(--surface-hover));
}

.editor-btn--secondary {
  color: var(--secondary);
}

.editor-btn--primary {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--accent);
}

.editor-btn--primary:hover {
  color: #fff;
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.editor-btn--danger {
  color: #fff;
  border-color: color-mix(in srgb, #d65f6a 60%, transparent);
  background: #d65f6a;
}

.editor-btn--danger:hover {
  color: #fff;
  border-color: #de6d78;
  background: #de6d78;
}

.editor-inline-keybar {
  margin-bottom: 0.75rem;
}

.editor-inline-form {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  max-width: 560px;
}

.editor-inline-form__label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.editor-inline-form__label span {
  color: color-mix(in srgb, var(--text-secondary) 92%, var(--text-muted));
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-inline-input {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.editor-inline-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-muted) 65%, transparent);
}

.editor-inline-error {
  min-height: 1.2rem;
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: color-mix(in srgb, #de5f69 95%, #fff 5%);
}

.editor-key-list {
  display: grid;
  gap: 0.35rem;
  max-height: 62vh;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 40%, transparent) transparent;
}

.editor-key-row {
  width: 100%;
  min-width: 0;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-hover) 65%, transparent);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  overflow: hidden;
}

.editor-key-row:hover {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background: color-mix(in srgb, var(--accent-muted) 55%, var(--surface-hover));
}

.editor-key-row__key {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-primary);
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-key-row__preview {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
}

.editor-visibility-grid {
  display: grid;
  gap: 0.55rem;
}

.editor-form .editor-visibility-option {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  background: color-mix(in srgb, var(--surface-hover) 65%, transparent);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.editor-form .editor-visibility-option:hover {
  border-color: color-mix(in srgb, var(--border) 100%, var(--text-muted) 20%);
  background: color-mix(in srgb, var(--surface-hover) 85%, transparent);
}

.editor-form .editor-visibility-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.editor-form .editor-visibility-option .toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--text-muted) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  flex-shrink: 0;
  transition: background 200ms ease, border-color 200ms ease;
}

.editor-form .editor-visibility-option .toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 200ms ease, background 200ms ease;
}

.editor-form .editor-visibility-option input:checked + .toggle-track {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  border-color: var(--accent);
}

.editor-form .editor-visibility-option input:checked + .toggle-track::after {
  transform: translateX(14px);
  background: #fff;
}

.editor-form .editor-visibility-option span:not(.toggle-track) {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

/* Webkit scrollbar theming for editor surfaces */
.editor-modal::-webkit-scrollbar,
.editor-key-list::-webkit-scrollbar {
  width: 6px;
}

.editor-modal::-webkit-scrollbar-track,
.editor-key-list::-webkit-scrollbar-track {
  background: transparent;
}

.editor-modal::-webkit-scrollbar-thumb,
.editor-key-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 35%, transparent);
  border-radius: var(--radius-pill);
}

.editor-modal::-webkit-scrollbar-thumb:hover,
.editor-key-list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-muted) 55%, transparent);
}

/* On mobile, add bottom padding so footer clears the fixed toolbar */
@media (max-width: 1023px) {
  body.editor-enabled {
    padding-bottom: 2.5rem;
  }

  .editor-toolbar {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    padding: 0.35rem 0.5rem;
    gap: 0.4rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }

  .editor-toolbar__status {
    flex-shrink: 0;
    max-width: none;
    font-size: 0.65rem;
  }

  .editor-toolbar__actions {
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .editor-toolbar__btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.24rem 0.42rem;
    font-size: 0.63rem;
  }

  .editor-lang-grid,
  .editor-lang-grid--single-row,
  .editor-form-row--two,
  .editor-form-row--three,
  .editor-form-row--slug-urls {
    grid-template-columns: 1fr;
  }

  .editor-create-project {
    min-height: 170px;
  }

  .editor-modal__header {
    padding: 0.6rem 0.85rem;
  }

  .editor-modal__body {
    padding: 0.75rem 0.85rem 1rem;
  }

  .editor-inline-form {
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
