:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #f8fbff;
  --text: #111827;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --primary-soft: #e0ebff;
  --button-text: #ffffff;
  --shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

button, a {
  font: inherit;
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: inherit;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

..header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-user {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
}

.login-button {
  min-width: 104px;
}

.site-alert {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  width: min(1200px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.site-alert-success {
  background: #d1fae5;
  color: #064e3b;
  border: 1px solid #10b981;
}

.site-alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

.hidden {
  display: none !important;
}

.login-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-dialog {
  width: min(520px, 100%);
  padding: 2rem;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  color: var(--text);
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.close-login {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.login-copy,
.login-note {
  margin: 0 0 1rem;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
}

.login-form input::placeholder {
  color: var(--muted);
}

.gallery-section {
  padding: 3rem 0;
}

.gallery-copy {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 680px;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.gallery-card {
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.gallery-card img {
  width: 100%;
  display: block;
  object-fit: cover;
  height: 180px;
}

.library-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 640px;
}

.library-status {
  margin: 0 0 1.5rem;
  color: var(--primary);
  font-weight: 600;
}

.library-card {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: 24px;
  border: 1px solid var(--border);
}

.library-section {
  padding: 3rem 0;
}

.library-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.library-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.library-download.disabled,
.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.theme-toggle {
  border: 1px solid rgba(71, 85, 105, 0.16);
  background: #ffffff;
  color: #111827;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.active-link {
  color: var(--primary);
}

.admin-section {
  padding: 2.5rem 0 3rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 1.5rem;
}

.admin-card {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: 24px;
  border: 1px solid var(--border);
}

.admin-form label,
.admin-form .checkbox-label {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.admin-form input,
.admin-form select {
  width: 100%;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  padding: 0.95rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-inline-form {
  display: inline-block;
  margin: 0;
}

.admin-inline-form .button {
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
}

.admin-form-card {
  min-width: 290px;
}

.admin-list-card {
  overflow-x: auto;
}

.hero {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.hero-content {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #2563eb;
  font-size: 0.8rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 0.95;
}

.hero-text {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  color: #475569;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

.button-secondary {
  color: #2563eb;
  background: #e0ebff;
}

.button-danger {
  color: #ffffff;
  background: #dc2626;
}

.section {
  padding: 4.5rem 0;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-label {
  display: block;
  color: #2563eb;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.75rem;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 2rem;
  align-items: start;
}

.about-grid p {
  margin: 0 0 1rem;
  color: #475569;
}

.about-highlights {
  display: grid;
  gap: 1rem;
}

.highlight-item {
  padding: 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #ffffff;
}

.highlight-item strong {
  display: block;
  margin-bottom: 0.6rem;
  color: #111827;
}

.highlight-item span {
  color: #475569;
}

.cards-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  padding: 1.75rem;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.project-card {
  padding: 1.75rem;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.project-tag {
  display: inline-flex;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 2rem;
  align-items: stretch;
}

.contact-copy h2 {
  margin-top: 0;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--surface);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font: inherit;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.form-status {
  margin: 0;
  min-height: 1.4rem;
  font-size: 0.96rem;
  color: #dbeafe;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-pill {
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 600;
}

.contact-card {
  padding: 2.5rem;
  border-radius: 28px;
  background: var(--primary);
  color: #ffffff;
  text-align: left;
}

.contact-card h2 {
  margin: 0 0 1rem;
}

.contact-card p {
  margin: 0 0 1.5rem;
  color: #dbeafe;
}

.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.footer-inner {
  display: flex;
  justify-content: center;
}

.footer-inner p {
  margin: 0;
  color: #475569;
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .about-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 4rem 0;
  }

  .contact-card,
  .gallery-card,
  .library-card,
  .admin-card {
    padding: 1.5rem;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 0.95rem;
  }
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #070b18;
  --surface: #0f172a;
  --surface-alt: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --primary: #60a5fa;
  --primary-soft: #1e40af;
  --button-text: #ffffff;
  --shadow: 0 18px 40px rgba(37, 99, 235, 0.14);
}
