:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1018;
  --bg-elevated: #111822;
  --surface: #151d28;
  --surface-hover: #1b2532;
  --ink: #eef3f8;
  --muted: #9aabbc;
  --faint: #6f8194;
  --accent: #8ec8f0;
  --accent-dim: rgba(142, 200, 240, 0.14);
  --accent-strong: #a8d6f5;
  --accent-on: #071018;
  --line: rgba(238, 243, 248, 0.09);
  --glow: rgba(142, 200, 240, 0.16);
  --glow-soft: rgba(100, 150, 200, 0.1);
  --work-band: rgba(17, 24, 34, 0.72);
  --skill-band: rgba(21, 29, 40, 0.85);
  --nav-bg: rgba(10, 16, 24, 0.78);
  --modal-scrim: rgba(4, 8, 14, 0.78);
  --play-bg: rgba(10, 16, 24, 0.84);
  --media-bg: #0c121a;
  --danger: #f87171;
  --success: #34d399;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --max: 70rem;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f8fc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f0f5fb;
  --ink: #122033;
  --muted: #5a6d82;
  --faint: #7a8ea3;
  --accent: #3d9be0;
  --accent-dim: rgba(61, 155, 224, 0.12);
  --accent-strong: #2f87c9;
  --accent-on: #ffffff;
  --line: rgba(18, 32, 51, 0.1);
  --glow: rgba(61, 155, 224, 0.14);
  --glow-soft: rgba(61, 155, 224, 0.08);
  --work-band: rgba(255, 255, 255, 0.72);
  --skill-band: rgba(255, 255, 255, 0.9);
  --nav-bg: rgba(245, 248, 252, 0.86);
  --modal-scrim: rgba(18, 32, 51, 0.45);
  --play-bg: rgba(255, 255, 255, 0.92);
  --media-bg: #e8eef5;
  --shadow: 0 18px 40px rgba(18, 32, 51, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 75% 45% at 12% -8%, var(--glow), transparent 55%),
    radial-gradient(ellipse 55% 35% at 92% 8%, var(--glow-soft), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 48%, var(--bg) 100%);
  transition: background 0.25s ease;
}

.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 18%, black, transparent);
  pointer-events: none;
  opacity: 0.7;
}

.hero-media {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.hero-media.is-visible {
  opacity: 0.18;
}

[data-theme="light"] .hero-media.is-visible {
  opacity: 0.12;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 45%, transparent), var(--bg) 78%);
}

.wrap {
  width: min(100% - 3rem, var(--max));
  margin-inline: auto;
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg) !important;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--accent-on) !important;
  transform: translateY(-1px);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-dim);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
  width: 1.05rem;
  height: 1.05rem;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.hero {
  min-height: calc(100vh - 4.75rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5rem 0 5.5rem;
  max-width: 44rem;
}

.hero-role {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
  opacity: 0;
  animation: rise 0.7s ease 0.1s forwards;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.15rem;
  opacity: 0;
  animation: rise 0.8s ease 0.18s forwards;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 1rem;
  max-width: 34rem;
  opacity: 0;
  animation: rise 0.8s ease 0.28s forwards;
}

.hero-tagline {
  margin: 0 0 2.1rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  opacity: 0;
  animation: rise 0.8s ease 0.38s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  animation: rise 0.8s ease 0.48s forwards;
}

.hero-actions .btn {
  min-width: min(100%, 11rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

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

.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-dim);
}

.section {
  padding: 5rem 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.65rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.5vw, 2.25rem);
  letter-spacing: -0.025em;
  margin: 0 0 0.85rem;
}

.section-lead {
  margin: 0 0 2.25rem;
  max-width: 40rem;
  color: var(--muted);
}

.work-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--work-band);
}

.status-msg {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

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

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--media-bg);
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.035);
}

.project-media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, var(--accent-dim), transparent 55%),
    var(--bg-elevated);
  color: var(--faint);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
}

.play-btn {
  position: absolute;
  inset: auto auto 0.85rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 8px;
  background: var(--play-bg);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, color 0.2s ease;
}

.play-btn:hover {
  background: var(--accent);
  color: var(--accent-on);
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.2rem 1.2rem 1.35rem;
  gap: 0.6rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

.project-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.project-badge {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.project-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  flex: 1;
}

.case-study {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  padding: 0.55rem 0.75rem;
}

.case-study summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
}

.case-study summary::-webkit-details-marker {
  display: none;
}

.case-study summary::after {
  content: " +";
  font-weight: 700;
}

.case-study[open] summary::after {
  content: " −";
}

.case-study-body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-chip {
  display: inline-flex;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.3rem;
}

.project-links a {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

.project-links a:hover {
  text-decoration: underline;
}

.about-grid,
.skills-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 17.5rem);
    gap: 1.75rem;
    align-items: start;
  }

  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
  }
}

@media (max-width: 799px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .about-meta {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  .about-meta dd,
  .about-meta a {
    font-size: 0.92rem;
  }
}

.about-copy {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42rem;
  line-height: 1.7;
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  position: sticky;
  top: 5.5rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.about-meta-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  min-width: 0;
}

.about-meta-list > div {
  min-width: 0;
}

.about-meta dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.about-meta dd {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.contact-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.about-meta a {
  color: var(--accent);
  font-weight: 650;
  display: inline-block;
  max-width: 100%;
}

.about-meta a:hover {
  text-decoration: underline;
}

#contact {
  scroll-margin-top: 5.5rem;
}

.timeline {
  display: grid;
  gap: 0;
  max-width: 48rem;
}

.timeline-item {
  padding: 1.35rem 0 1.35rem 1.25rem;
  border-left: 2px solid var(--line);
  margin-left: 0.25rem;
}

.timeline-item:hover {
  border-left-color: var(--accent);
}

.timeline-role {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
}

.timeline-meta {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 650;
  margin: 0 0 0.5rem;
}

.timeline-body {
  margin: 0;
  color: var(--muted);
  max-width: 44rem;
  line-height: 1.65;
}

.skill-block {
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--skill-band);
  transition: border-color 0.2s ease;
}

.skill-block:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.skill-block h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.skill-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.footer {
  padding: 2.25rem 0 2.75rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
}

.footer a:hover {
  color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 1.25rem;
  background: var(--modal-scrim);
  backdrop-filter: blur(8px);
}

.modal.is-open {
  display: grid;
}

.modal-panel {
  width: min(100%, 56rem);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-frame iframe,
.modal-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 720px) {
  .nav-links > a:not(#nav-contact) {
    display: none;
  }

  .wrap {
    width: min(100% - 1.5rem, var(--max));
  }

  .hero {
    padding-top: 3rem;
    min-height: auto;
  }

  .about-meta {
    position: static;
  }
}

/* —— Admin —— */
.admin-body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.admin-shell {
  width: min(100% - 2rem, 56rem);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.admin-card h1,
.admin-card h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.admin-muted {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.tab.is-active {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

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

.form-row label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.form-row textarea {
  min-height: 110px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.hidden {
  display: none !important;
}

.admin-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.admin-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.admin-list-item strong {
  font-family: var(--font-display);
}

.flash {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.flash-ok {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.flash-err {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.preview-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}

@media (min-width: 700px) {
  .form-2 {
    grid-template-columns: 1fr 1fr;
  }
}
