:root {
  color-scheme: light;
  --bg: #f7f8ff;
  --bg-accent: #e8f0ff;
  --surface: #ffffff;
  --surface-2: #edf4ff;
  --text: #172033;
  --muted: #61708f;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --border: rgba(23, 32, 51, 0.1);
  --shadow: 0 20px 45px rgba(16, 24, 40, 0.1);
}

body.theme-default {
  color-scheme: light;
  --bg: #f7f8ff;
  --bg-accent: #e8f0ff;
  --surface: #ffffff;
  --surface-2: #edf4ff;
  --text: #172033;
  --muted: #61708f;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --border: rgba(23, 32, 51, 0.1);
  --shadow: 0 20px 45px rgba(16, 24, 40, 0.1);
}

body.theme-white {
  color-scheme: light;
  --bg: #ffffff;
  --bg-accent: #f5f7ff;
  --surface: #ffffff;
  --surface-2: #f2f5ff;
  --text: #111827;
  --muted: #5f6b7a;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

body.theme-green {
  color-scheme: light;
  --bg: #f3fcf7;
  --bg-accent: #dff6e8;
  --surface: #ffffff;
  --surface-2: #dff7e5;
  --text: #173226;
  --muted: #5f7669;
  --accent: #0f766e;
  --accent-2: #16a34a;
  --border: rgba(23, 50, 38, 0.12);
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

body.theme-yellow {
  color-scheme: light;
  --bg: #fff9e8;
  --bg-accent: #fff3cf;
  --surface: #fffdf8;
  --surface-2: #fef2c7;
  --text: #3f2e10;
  --muted: #8a6c31;
  --accent: #d97706;
  --accent-2: #f59e0b;
  --border: rgba(63, 46, 16, 0.12);
  --shadow: 0 18px 42px rgba(120, 53, 15, 0.1);
}

body.theme-black {
  color-scheme: dark;
  --bg: #050816;
  --bg-accent: #111a33;
  --surface: #0c1630;
  --surface-2: #17244d;
  --text: #eaf3ff;
  --muted: #98a4c0;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 45%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.45s ease;
}

body.theme-black::before {
  background: radial-gradient(circle at top right, rgba(124, 147, 255, 0.28), transparent 44%);
}

body.theme-transition::before {
  animation: themeSweep 0.7s ease;
}

@keyframes themeSweep {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  40% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

body.theme-black .top-nav {
  background: rgba(8, 15, 25, 0.8);
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a,
.social-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.nav-links a:hover,
.social-link:hover {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.clock {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

button,
select,
input[type="checkbox"] {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

input[type="checkbox"] {
  padding: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

button:hover,
select:hover,
button:focus-visible,
select:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

button:active {
  transform: translateY(0) scale(0.98);
}

.nav-links a,
.social-link,
.contact-link,
.settings-toggle {
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-links a:hover,
.social-link:hover,
.contact-link:hover,
.settings-toggle:hover {
  transform: translateY(-2px);
  color: var(--accent);
}

.theme-toggle {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  min-width: 118px;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2);
  border-color: transparent;
}

select.theme-toggle {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, white 50%), linear-gradient(135deg, white 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.theme-toggle:hover {
  transform: translateY(-3px) scale(1.02);
}

.settings-toggle {
  background: var(--surface);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.settings-card {
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 1.5rem;
}

.settings-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--surface-2);
}

.setting-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.night-mode-button {
  background: linear-gradient(135deg, #111827, #374151);
  color: white;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 55px rgba(20, 33, 61, 0.16);
}

.card.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.card.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  position: relative;
  overflow: hidden;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  opacity: 0.8;
}

.welcome-line {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  opacity: 0.95;
}

h1, h2 {
  margin-top: 0;
}

ul {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.image-square-wrapper {
  margin-top: 1rem;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

.image-square-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-intro {
  margin-bottom: 1.25rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-card-item {
  background: var(--surface-2);
  border-radius: 18px;
  padding: 1rem;
}

.contact-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.contact-note {
  margin-top: 1rem;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.email {
  color: var(--muted);
}

footer {
  text-align: center;
  padding: 1rem 0 2rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}