:root {
  --bg-deep: #071018;
  --bg-card: rgba(15, 40, 48, 0.72);
  --neon: #00e8ff;
  --neon-soft: #5cf9ff;
  --mint: #c8f5ef;
  --mint-dim: #8ecbc4;
  --text: #e8fbff;
  --muted: #9bc4c9;
  --border: rgba(0, 232, 255, 0.35);
  --glow: 0 0 28px rgba(0, 232, 255, 0.22);
  /* Apple-like ease: strong deceleration at the end */
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-apple-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur-hero: 1.15s;
  --dur-section: 1.05s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

html:has(body.home) {
  scroll-snap-type: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

/* Legacy teal atmosphere — not used on home or admin */
body:not(.home):not(.admin) {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 232, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(200, 245, 239, 0.12), transparent 50%),
    linear-gradient(165deg, #050a10 0%, var(--bg-deep) 45%, #041218 100%);
}

/* Home: profile landing — calm dark UI, single accent */
body.home {
  --profile-bg: #09090b;
  --profile-text: #fafafa;
  --profile-muted: #a1a1aa;
  --profile-faint: #71717a;
  --profile-accent: #38bdf8;
  --profile-accent-ring: rgba(56, 189, 248, 0.35);
  --profile-surface: rgba(255, 255, 255, 0.04);
  --profile-surface-hover: rgba(255, 255, 255, 0.055);
  --profile-edge: rgba(255, 255, 255, 0.08);
  --profile-glow: rgba(56, 189, 248, 0.09);
  --text: var(--profile-text);
  --text-soft: #d4d4d8;
  --text-muted: var(--profile-muted);
  background-color: var(--profile-bg);
  color: var(--profile-text);
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

body.home a {
  color: var(--profile-accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

body.home a:hover {
  color: #7dd3fc;
}

body.home a:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.profile-bg,
.admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 65% at 50% -15%, var(--profile-glow), transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 5%, rgba(99, 102, 241, 0.06), transparent 50%),
    radial-gradient(ellipse 45% 35% at 0% 30%, rgba(56, 189, 248, 0.05), transparent 45%);
}

body.home .page.profile {
  position: relative;
  z-index: 1;
}

.top-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.85rem 1rem 0;
}

.top-nav {
  max-width: 58rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
  border: 1px solid var(--profile-edge);
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.top-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  color: var(--profile-muted);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

body.home a.top-nav__link:hover {
  color: var(--profile-text);
  border-color: var(--profile-edge);
  background: rgba(255, 255, 255, 0.07);
}

/* Admin: same design language as public profile */
body.admin {
  --profile-bg: #09090b;
  --profile-text: #fafafa;
  --profile-muted: #a1a1aa;
  --profile-faint: #71717a;
  --profile-accent: #38bdf8;
  --profile-accent-hover: #7dd3fc;
  --profile-accent-ring: rgba(56, 189, 248, 0.35);
  --profile-surface: rgba(255, 255, 255, 0.04);
  --profile-surface-2: rgba(255, 255, 255, 0.06);
  --profile-edge: rgba(255, 255, 255, 0.08);
  --profile-glow: rgba(56, 189, 248, 0.09);
  --text: var(--profile-text);
  --muted: var(--profile-muted);
  background-color: var(--profile-bg);
  color: var(--profile-text);
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

body.admin a {
  color: var(--profile-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

body.admin a:hover {
  color: var(--profile-accent-hover);
}

body.admin a:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: var(--neon-soft);
}

.page {
  min-height: 100vh;
}

/* Full-viewport welcome */
.hero-full {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3.5rem;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  overflow: clip;
}

.hero-full__inner {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: auto 0;
  perspective: 1400px;
}

body.home .hero-full__inner {
  max-width: 28rem;
}

.hero-motion-outer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

/* Inner: children stagger via .hero-reveal (home only) */
.hero-motion-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

body.home .hero-motion-inner {
  gap: 2rem;
}

/* Home: staggered intro — light, no heavy blur */
html.js body.home .hero-reveal {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

html.js body.home.is-ready .hero-reveal {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.85s var(--ease-apple),
    transform 0.9s var(--ease-apple);
  transition-delay: calc((var(--reveal-step, 1) - 1) * 0.12s);
}

@media (prefers-reduced-motion: reduce) {
  html.js body.home .hero-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.brand {
  text-align: center;
}

.brand.hero-brand {
  margin-bottom: 0;
}

.brand img {
  max-width: min(320px, 88vw);
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(var(--glow));
}

/* Profile avatar: circular frame (works for square logos too) */
body.home .profile-badge {
  margin: 0;
}

body.home .profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 3px;
  margin: 0 auto;
  background: linear-gradient(145deg, var(--profile-accent) 0%, rgba(99, 102, 241, 0.55) 100%);
  box-shadow:
    0 0 0 1px var(--profile-edge),
    0 12px 40px rgba(0, 0, 0, 0.45);
}

body.home .profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 50%;
  object-fit: contain;
  padding: 14px;
  background: #18181b;
}

.hero-panel {
  text-align: center;
  width: 100%;
  padding: 2rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--glow);
  transform: translateZ(0);
  backface-visibility: hidden;
}

body.home .hero-panel {
  padding: 2rem 1.75rem 2.25rem;
  border: 1px solid var(--profile-edge);
  border-radius: 20px;
  background: var(--profile-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
}

body.home .hero-panel .hero-reveal--title + .hero-reveal--sub {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--profile-edge);
}

.hero-panel .hero-reveal--title h1 {
  margin: 0;
}

.hero-panel .hero-reveal--sub p {
  margin: 0;
}

.hero-panel h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--mint), var(--neon), var(--neon-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.home .hero-panel h1 {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--profile-text);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

body.home .hero-panel p {
  color: var(--profile-muted);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.scroll-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mint-dim);
  opacity: 0.88;
  pointer-events: none;
  animation: scroll-hint-pulse 2.75s var(--ease-apple-soft) infinite;
}

body.home .scroll-hint {
  color: var(--profile-faint);
  letter-spacing: 0.2em;
}

@keyframes scroll-hint-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 0.92;
    transform: translateX(-50%) translateY(7px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .scroll-hint {
      animation: scroll-hint-fade linear forwards;
      animation-timeline: scroll(root);
      animation-range: 0 28vh;
    }
  }
}

@keyframes scroll-hint-fade {
  from {
    opacity: 0.88;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint {
    animation: none;
    opacity: 0.72;
  }
}

/* Stacked sections below the fold */
.site-main {
  width: 100%;
}

.content-section {
  padding: clamp(2.75rem, 9vh, 5rem) 1.25rem;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

body.home .profile-main .profile-block {
  padding: clamp(3rem, 8vh, 5rem) 1.25rem;
  box-sizing: border-box;
}

body.home .profile-main .section-inner {
  max-width: 34rem;
  width: 100%;
}

.content-section--last {
  padding-bottom: clamp(3.25rem, 11vh, 5.5rem);
}

body.home .content-section--last {
  padding-bottom: clamp(3.5rem, 10vh, 5rem);
}

.section-inner {
  max-width: 920px;
  margin: 0 auto;
}

/* About: float / slide in when scrolling into view; resets when scrolling away */
.reveal {
  transition: none;
}

html.js body.home #about.reveal:not(.reveal--visible) .about-card {
  opacity: 0;
  transform: translate3d(0, 56px, 0) scale(0.98);
  box-shadow: none;
}

html.js body.home #about.reveal--visible .about-card {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 0.92s var(--ease-apple),
    transform 0.95s var(--ease-apple),
    box-shadow 0.85s ease;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  html.js body.home #about.reveal:not(.reveal--visible) .about-card {
    opacity: 1;
    transform: none;
  }

  html.js body.home #about.reveal--visible .about-card {
    transition: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  }
}

.card {
  padding: 1.35rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(6, 20, 26, 0.65);
  transform: translateZ(0);
  backface-visibility: hidden;
}

body.home .card.profile-card {
  padding: 1.65rem 1.5rem 1.75rem;
  border-radius: 16px;
  border: 1px solid var(--profile-edge);
  background: var(--profile-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}

body.home .card.profile-card:hover {
  background: var(--profile-surface-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.card--motion {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

body.home .card--motion.profile-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  color: var(--mint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

body.home .card h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--profile-accent);
  margin-bottom: 0.85rem;
}

.card p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}

body.home .card p {
  color: var(--profile-muted);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
}

.footer {
  margin: 0;
  padding: 0 1.25rem 2.5rem;
  text-align: center;
  color: var(--mint-dim);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

body.home .footer {
  color: var(--profile-faint);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* Admin pages (login, setup, panel) */
.admin-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-card {
  width: 100%;
  max-width: 26rem;
  padding: 2rem 1.75rem 2.25rem;
  border-radius: 20px;
  border: 1px solid var(--profile-edge);
  background: var(--profile-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

body.admin .admin-card h1 {
  margin: 0 0 1.35rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--profile-text);
}

.admin-lead,
.admin-intro {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--profile-muted);
}

.admin-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--profile-muted);
}

.admin-caption {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--profile-faint);
  font-size: 0.8125rem;
}

.admin-code {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.85em;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--profile-edge);
  color: var(--profile-accent);
}

.admin-label-spaced {
  margin-top: 1rem !important;
}

/* Shared form controls (card + panel) */
body.admin label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--profile-muted);
}

body.admin .admin-card form > label:first-of-type {
  margin-top: 1.2rem;
}

body.admin .admin-panel-wrap input + label,
body.admin .admin-panel-wrap textarea + label {
  margin-top: 1rem;
}

body.admin .admin-panel-wrap section > h2 + label {
  margin-top: 0.65rem;
}

body.admin .admin-panel-wrap section > h2 + .admin-hint {
  margin-bottom: 0.65rem;
}

body.admin .admin-panel-wrap section > h2 + .admin-hint + label {
  margin-top: 0;
}

body.admin input[type="text"],
body.admin input[type="password"],
body.admin input[type="file"],
body.admin textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--profile-edge);
  background: rgba(0, 0, 0, 0.4);
  color: var(--profile-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

body.admin input::placeholder,
body.admin textarea::placeholder {
  color: var(--profile-faint);
}

body.admin input[type="text"]:hover,
body.admin input[type="password"]:hover,
body.admin textarea:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

body.admin input[type="text"]:focus,
body.admin input[type="password"]:focus,
body.admin textarea:focus {
  outline: none;
  border-color: var(--profile-accent-ring);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: rgba(0, 0, 0, 0.5);
}

body.admin input[type="file"] {
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--profile-muted);
}

body.admin input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--profile-edge);
  border-radius: 8px;
  background: var(--profile-surface-2);
  color: var(--profile-text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

body.admin input[type="file"]::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

body.admin textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
}

/* Primary button */
body.admin button:not(.secondary) {
  margin-top: 1.35rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0a0a0b;
  background: linear-gradient(180deg, #5ecfff 0%, var(--profile-accent) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 16px rgba(56, 189, 248, 0.25);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

body.admin button:not(.secondary):hover {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 6px 20px rgba(56, 189, 248, 0.32);
}

body.admin button:not(.secondary):active {
  transform: translateY(1px);
}

body.admin button:not(.secondary):focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 3px;
}

/* Secondary / outline */
body.admin button.secondary {
  margin-top: 0;
  width: auto;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--profile-edge);
  background: transparent;
  color: var(--profile-muted);
  font-weight: 500;
  box-shadow: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

body.admin button.secondary:hover {
  color: var(--profile-text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  filter: none;
}

body.admin .inline-actions button:not(.secondary) {
  width: auto;
  min-width: 10rem;
}

.admin-error {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 0.875rem;
  line-height: 1.45;
}

.admin-ok {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.35);
  color: #a7f3d0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.admin-panel-wrap {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

body.admin .admin-panel-wrap > h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--profile-text);
}

.admin-panel-wrap form section {
  margin-top: 1.25rem;
  padding: 1.5rem 1.35rem 1.6rem;
  border-radius: 16px;
  border: 1px solid var(--profile-edge);
  background: var(--profile-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.admin-panel-wrap form section:first-of-type {
  margin-top: 1.75rem;
}

body.admin .admin-panel-wrap h2 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--profile-accent);
}

body.admin .admin-panel-wrap section > h2 + p.admin-hint {
  margin-top: 0;
}

.inline-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
}

.admin-logout-form {
  margin-top: 1.75rem;
}

.logo-preview {
  max-width: 200px;
  max-height: 100px;
  object-fit: contain;
  margin-top: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--profile-edge);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem;
}

.nav-links-list {
  display: grid;
  gap: 0.8rem;
}

.nav-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
  gap: 0.7rem;
  align-items: end;
  padding: 0.85rem;
  border: 1px solid var(--profile-edge);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.nav-link-row .secondary.nav-remove-btn {
  margin: 0;
}

#add-nav-link-btn {
  margin-top: 0.85rem;
}

@media (max-width: 720px) {
  .nav-link-row {
    grid-template-columns: 1fr;
  }
}
