:root {
  color-scheme: light;
  --red: #AA0000;
  --gold: #B3995D;
  --bg: #ffffff;
  --ink: #1a1414;
  --muted: #5e5550;
  --line: #d9cfbd;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #140d0d;
  --ink: #f3ece0;
  --muted: #b5a99a;
  --line: #3a2a22;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Hero */
.hero {
  min-height: 92vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 24px;
  border-bottom: 6px solid var(--red);
}
.photo {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 28px;
  background: var(--red);
  border: 4px solid var(--gold);
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: none; }
.photo.has img { display: block; }
.photo .ph { font-size: 56px; font-weight: 800; color: var(--gold); }
.photo .hint { position: absolute; bottom: 14px; font-size: 12px; color: #fff; }
.photo.has .ph, .photo.has .hint { display: none; }
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

h1 {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.02;
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero p { max-width: 46ch; margin: 0 auto; color: var(--muted); font-size: 1.15rem; }
.cue { margin-top: 40px; font-size: 0.95rem; color: var(--gold); font-weight: 600; }

/* Work layout */
.work {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 40px;
  align-items: start;
}
.work h2 { font-size: 1.6rem; margin: 0 0 24px; letter-spacing: -0.02em; }

/* Stacking project cards */
.card {
  position: sticky;
  top: calc(24px + var(--i) * 28px);
  min-height: 340px;
  margin-bottom: 60px;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
  --card-ink: #1a1414;
  --card-muted: #5e5550;
  --card-accent: var(--red);
  --card-accent-ink: #fff;
  color: var(--card-ink);
}
.card:nth-child(1) { background: #ffffff; }
.card:nth-child(2) {
  background: var(--red);
  --card-ink: #fff;
  --card-muted: #f0d6d6;
  --card-accent: var(--gold);
  --card-accent-ink: #1a1414;
}
.card:nth-child(3) { background: var(--gold); --card-muted: #3d3320; }

.card h3 { font-size: 1.9rem; margin: 0 0 10px; letter-spacing: -0.02em; }
.card p { margin: 0; max-width: 52ch; color: var(--card-muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.tags li { border: 1px solid currentColor; border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; }
.btn {
  display: inline-block;
  margin-top: 24px;
  align-self: flex-start;
  background: var(--card-accent);
  color: var(--card-accent-ink);
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

/* Right column: Skills + About Me */
.sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 32px;
}
.skills,
.aboutMe {
  border-left: 4px solid var(--red);
  padding: 4px 0 4px 20px;
}
.skills h2,
.aboutMe h2 { font-size: 1.2rem; margin: 0 0 12px; }
.skills ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.skills li { font-size: 1.1rem; font-weight: 600; }
.skills li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--gold); border-radius: 50%; }
.aboutMe p { margin: 0 0 8px; font-size: 1.1rem; font-weight: 600; }

/* Footer */
footer {
  background: var(--red);
  color: #fff;
  padding: 40px 24px;
  text-align: center;
  border-top: 6px solid var(--gold);
}
footer nav { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
footer a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--gold); }
footer small { color: #f0d6d6; }

@media (max-width: 760px) {
  .work { grid-template-columns: 1fr; }
  .skills { position: static; order: -1; }
  .aboutMe { position: static; order: -2; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* Theme switch */
.theme-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 64px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.25s;
}
.theme-switch .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  transition: transform 0.25s;
}
.theme-switch .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
}
.theme-switch .sun { right: 8px; }
.theme-switch .moon { left: 8px; }
.theme-switch[aria-checked="true"] .thumb { transform: translateX(32px); }
.theme-switch[aria-checked="true"] { background: #2a1d1d; }

@media (prefers-reduced-motion: reduce) {
  .theme-switch, .theme-switch .thumb { transition: none; }
}