:root {
  /* Background */
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-alt: #111111;

  /* Gold Theme */
  --primary: #d4af37;        /* classic gold */
  --primary-dark: #b8962e;
  --accent: #ffd700;         /* bright gold highlight */

  /* Text */
  --text: #d4af37;           /* gold text */
  --muted: #a68c2a;          /* soft gold */

  /* UI */
  --border: #1f1f1f;

  /* Design */
  --radius: 14px;
  --radius-sm: 8px;

  /* Elegant shadow */
  --shadow: 0 10px 40px rgba(212, 175, 55, 0.15);

  /* Layout */
  --container: 1120px;

  /* Smooth feel */
  --transition: 0.3s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html {
    overflow-x: clip;
  }
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--text);
  background: black;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

body.bottom-nav {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}


html {
  scroll-padding-top: 96px;
}
.matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: #000;
}

@supports (overflow-x: clip) {
  body {
    overflow-x: clip;
  }
}

/* Dragon Background Animation */
#dragon-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  filter: sepia(20%);
}

main > section,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 10;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(52, 131, 221, 0.55);
  backdrop-filter: blur(10px);
  background-color: rgba(10, 10, 10, 0.8);
}

nav.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
  padding: 0.95rem 0;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-links .btn {
  padding: 0.55rem 1rem;
}

/* Bottom-center glass navbar (index only) */
header.site-header.site-header--bottom {
  position: fixed;
  top: auto;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

header.site-header.site-header--bottom .container {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

header.site-header.site-header--bottom nav.main-nav {
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  flex-wrap: nowrap;
  justify-content: center;

  background-color: var(--surface);
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--border) 65%, transparent);
  backdrop-filter: blur(15px);

  box-shadow: var(--shadow);
  filter: drop-shadow(0 0 18px var(--accent));
}

header.site-header.site-header--bottom .brand {
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.25rem;
}

header.site-header.site-header--bottom .nav-links {
  flex-wrap: nowrap;
  gap: 1.25rem;
}

header.site-header.site-header--bottom .nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  position: relative;
  transition: 0.3s;
  white-space: nowrap;
}

header.site-header.site-header--bottom .nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: 0.3s;
}

header.site-header.site-header--bottom .nav-links a:hover {
  color: var(--accent);
}

header.site-header.site-header--bottom .nav-links a:hover::after {
  width: 100%;
}

@media (max-width: 768px) {
  body.bottom-nav {
    padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px));
  }

  header.site-header.site-header--bottom {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 24px);
  }

  header.site-header.site-header--bottom nav.main-nav {
    width: 100%;
    border-radius: var(--radius);
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
  }

  header.site-header.site-header--bottom .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    gap: 0.85rem;
  }

  header.site-header.site-header--bottom .nav-links a {
    font-size: 0.85rem;
  }
}

.nav-links a {
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary-dark);
  background-color: rgba(14, 116, 144, 0.11);
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 26px rgba(14, 116, 144, 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--surface-alt);
  color: var(--text);
}

.section {
  padding: 5rem 0 3rem;
}

.section h2 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.7rem, 2vw, 2.3rem);
  font-family: "Space Grotesk", sans-serif;
}

.section-intro {
  margin-top: 0;
  color: var(--muted);
  max-width: 70ch;
}

.hero {
  padding: 4.5rem 0 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.8rem;
  align-items: center;
  justify-items: center;
}

.hero-card,
.info-card,
.form-card,
.details-card,
.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: clamp(1.3rem, 2.2vw, 2.4rem);
  width: 100%;
  max-width: 70ch;
  text-align: center;
}

.hero-title {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  font-family: "Space Grotesk", sans-serif;
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  color: var(--muted);
  margin-bottom: 1.2rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero .social-list {
  justify-content: center;
}

.social-list {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.social-list a {
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
}

.social-list a:hover {
  color: var(--primary-dark);
}

.hero-photo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  min-height: clamp(300px, 42vw, 470px);
  padding: 0;
  background:
    linear-gradient(150deg, rgba(14, 116, 144, 0.9), rgba(21, 94, 117, 0.95)),
    radial-gradient(circle at right top, rgba(255, 255, 255, 0.2), transparent 45%);
  position: relative;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.85;
}

#profileImageHero {
  min-height: clamp(300px, 42vw, 470px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 116, 144, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

.card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.94rem;
  font-weight: 600;
}

.card p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
  flex-grow: 1;
}

.card img {
  border-radius: 10px;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 0.5rem;
  margin-top: -0.15rem;
}

.card small {
  display: block;
  margin-top: auto;
  padding-top: 0.3rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.84rem;
}

.timeline {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0.2rem 0 1rem 1.1rem;
}

.timeline-image {
  width: 100%;
  max-width: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 16 / 10;
  margin: 0.2rem 0 0.6rem;
}

.timeline li::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent);
  position: absolute;
  left: -7px;
  top: 0.4rem;
}

.timeline strong {
  display: block;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0.8rem;
}

.about-layout .info-card {
  padding: 0.8rem;
}

.profile-img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  max-height: 420px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
}

.info-list {
  margin: 0;
  padding: 1rem;
  list-style: none;
}

.info-list li {
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--border);
}

.info-list__heading {
  padding-top: 0;
  padding-bottom: 0.9rem;
}

.info-list__heading h2 {
  margin: 0;
}

.info-list__social {
  padding-top: 0.9rem;
}

.info-list span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-list li:last-child {
  border-bottom: none;
}

.form-card {
  padding: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.input-wrap {
  margin-bottom: 0.8rem;
}

.input-wrap input[type="file"] {
  padding: 0.55rem;
  background-color: var(--surface-alt);
}

.input-wrap button.btn-secondary {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.upload-actions .btn-secondary {
  margin-top: 0;
}

.upload-preview {
  margin-top: 0.6rem;
  width: min(100%, 280px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--surface-alt);
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

.upload-gallery {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.45rem;
}

.upload-gallery-item {
  position: relative;
}

.upload-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.upload-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.admin-card form > .btn-primary {
  margin-top: 0.35rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
  font: inherit;
  outline: none;
  background-color: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(14, 116, 144, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.13);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.status {
  margin-top: 0.8rem;
  color: var(--muted);
  min-height: 1.3rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 2.4rem;
  background: linear-gradient(180deg, rgba(19, 14, 14, 0.7), rgba(15, 16, 17, 0.7));
  color: var(--muted);
}

.footer .container {
  padding-top: 1.8rem;
  padding-bottom: 1.2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.4rem;
}

.footer-section h3,
.footer-logo {
  margin: 0 0 0.7rem;
  color: var(--text);
}

.footer-logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.footer-logo span {
  color: var(--primary);
}

.footer-section p {
  margin: 0;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-section a {
  color: var(--muted);
  transition: color var(--transition);
}

.footer-section a:hover,
.footer-section a:focus-visible {
  color: var(--primary-dark);
}

.footer-social {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.footer-social a:hover,
.footer-social a:focus-visible {
  border-color: rgba(14, 116, 144, 0.35);
  background-color: rgba(14, 116, 144, 0.1);
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer-contact a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  background-color: rgba(7, 7, 7, 0.75);
}

.footer-bottom .container {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.footer-bottom-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.footer-bottom-content p {
  margin: 0;
}

.scroll-to-top {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
  background-color: rgba(14, 116, 144, 0.1);
  border-color: rgba(14, 116, 144, 0.35);
}

.page-header {
  padding: 3.2rem 0 1rem;
}

.page-header p {
  color: var(--muted);
}

.details-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.2fr 1fr;
}

.details-layout > * {
  min-width: 0;
}

.details-card {
  padding: 1rem;
}

.detail-hero-image {
  width: 100%;
  max-width: 340px;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 16 / 10;
  margin-bottom: 0.8rem;
}

.badge-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.36rem 0.62rem;
  border-radius: 999px;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.project-links {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.project-links .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.slider {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.slider-track {
  display: flex;
  transition: transform 0.45s ease;
}

.slider-track img {
  min-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.slider-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.slider-nav button {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  flex: 1 1 140px;
}

.auth-layout {
  min-height: calc(100vh - 70px);
  min-height: calc(100dvh - 70px);
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.admin-layout {
  min-height: calc(100vh - 70px);
  min-height: calc(100dvh - 70px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 0;
}

.auth-card {
  width: min(460px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.admin-shell {
  width: min(1200px, 100%);
  padding-inline: clamp(1rem, 4vw, 1.5rem);
  display: grid;
  gap: 1rem;
  grid-template-columns: 280px 1fr;
}

.admin-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  align-self: start;
  position: sticky;
  top: 85px;
}

.admin-sidebar button,
.tab-btn {
  width: 100%;
  text-align: left;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.55rem;
  cursor: pointer;
}

.tab-btn.active {
  background-color: rgba(14, 116, 144, 0.14);
  border-color: rgba(14, 116, 144, 0.35);
}

.admin-main {
  display: grid;
  gap: 0.8rem;
}

.admin-card {
  padding: 0.8rem;
}

.admin-card h2 {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th:last-child,
table td:last-child {
  white-space: nowrap;
}

th,
td {
  text-align: left;
  padding: 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.action-btn {
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  margin-right: 0.35rem;
  cursor: pointer;
}

.action-btn.edit {
  background-color: rgba(14, 116, 144, 0.14);
  color: var(--primary-dark);
}

.action-btn.delete {
  background-color: rgba(220, 38, 38, 0.16);
  color: #b91c1c;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  #dragon-bg,
  .matrix-canvas {
    display: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero,
  .about-layout,
  .contact-layout,
  .details-layout,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.85rem;
    -webkit-overflow-scrolling: touch;
  }

  .admin-sidebar .tab-btn {
    width: auto;
    margin-bottom: 0;
    flex: 0 0 auto;
    text-align: center;
  }

  .hero-photo {
    min-height: 280px;
  }

  #profileImageHero {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 3.7rem;
  }

  nav.main-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    padding-bottom: 0.2rem;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 0.55rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    font-size: 0.95rem;
    justify-content: flex-start;
    white-space: nowrap;
  }

  html {
    scroll-padding-top: 140px;
  }

  .page-header {
    padding-top: 2.4rem;
  }

  .page-header h1 {
    font-size: clamp(1.6rem, 6vw, 2rem);
    margin-bottom: 0.35rem;
  }

  .page-header p {
    margin-top: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .input-wrap button.btn-secondary,
  .admin-card form > .btn-primary {
    width: 100%;
  }

  .footer-bottom-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-top: 3.8rem;
  }

  .hero-card {
    text-align: left;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}
