:root {
  --accent: #D10373;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #ffffff;
  --card: #f6f6f8;
  --border: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.07);
  --glow-1: rgba(209, 3, 115, 0.22);
  --glow-2: rgba(255, 140, 70, 0.22);
  --glow-3: rgba(190, 30, 180, 0.16);
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", Arial, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

main, .hero, footer {
  max-width: 980px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: 96px;
  padding-bottom: 64px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -15%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(circle at 80% 15%, var(--glow-2) 0%, transparent 55%),
    radial-gradient(circle at 60% 75%, var(--glow-3) 0%, transparent 60%);
  filter: blur(70px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: end;
}

@media (min-width: 720px) {
  .hero-grid { grid-template-columns: 1.3fr 1fr; gap: 48px; }
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 em {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.intro { font-size: 1.15rem; color: var(--muted); max-width: 420px; margin: 0; }

.button {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 32px;
  border: 1px solid var(--accent);
  transition: opacity 0.2s, border-color 0.2s, color 0.2s;
}
.button:hover { opacity: 0.85; }

.button--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  margin-top: 0;
}
.button--outline:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

section { padding: 56px 0; }

section .eyebrow { margin-bottom: 8px; }

h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

section p { color: var(--muted); max-width: 640px; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.project {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.project h3 { margin-top: 0; }
.project p { max-width: none; }
.project .button--outline { margin-top: 16px; padding: 8px 18px; font-size: 0.9rem; }

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.back-link:hover { color: var(--accent); }

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Sections stay plain and fully visible until script.js confirms it can
   run the fade-in animation, which is when it adds "js-fade" to <body>.
   So if JavaScript fails, this rule never applies and everything just
   shows up normally. */
body.js-fade main section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
body.js-fade main section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f0f0f0;
    --muted: #a0a0a0;
    --bg: #111111;
    --card: #1c1c1f;
    --border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 40px rgba(0, 0, 0, 0.35);
    --glow-1: rgba(209, 3, 115, 0.45);
    --glow-2: rgba(255, 140, 70, 0.35);
    --glow-3: rgba(190, 30, 180, 0.3);
  }
}

/* These two blocks let the toggle button override the system setting.
   An attribute selector like :root[data-theme="dark"] is more specific
   than the plain :root above, so it always wins once script.js sets
   data-theme on <html> — regardless of what the OS prefers. */
:root[data-theme="dark"] {
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --bg: #111111;
  --card: #1c1c1f;
  --border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 40px rgba(0, 0, 0, 0.35);
  --glow-1: rgba(209, 3, 115, 0.45);
  --glow-2: rgba(255, 140, 70, 0.35);
  --glow-3: rgba(190, 30, 180, 0.3);
}

:root[data-theme="light"] {
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #ffffff;
  --card: #f6f6f8;
  --border: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.07);
  --glow-1: rgba(209, 3, 115, 0.22);
  --glow-2: rgba(255, 140, 70, 0.22);
  --glow-3: rgba(190, 30, 180, 0.16);
}
