:root {
  --max-width: 1100px;
  --padding: 1.5rem;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;

  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-primary: #111827;
  --color-accent: #2563eb;
  --color-text-main: #111827;
  --color-text-muted: #6b7280;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text-main);
  padding: var(--padding);
  line-height: 1.6;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* NAVBAR */

.site-header {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  background-color: var(--color-surface);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-main {
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-sub {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-main);
  font-weight: 500;
  position: relative;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.2s ease;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.9);
  outline-offset: 3px;
  border-radius: 999px;
}

.theme-toggle {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 2.2rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.1s ease;
}

.theme-toggle:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

/* HERO */

.hero {
  margin-top: 2rem;
  padding: 4.2rem 1.5rem 4.6rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 55%),
    radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.16), transparent 55%),
    var(--color-surface);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.12);
  text-align: left;
}

.hero-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 1rem;
}

.hero-text {
  font-size: 1.05rem;
  max-width: 620px;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.hero-meta span {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.25rem 0.8rem;
  background: rgba(255, 255, 255, 0.7);
}

/* Improve hero pills visibility in dark mode */
body.dark .hero-meta span {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.75);
  color: var(--color-text-main);
}

/* CTAs */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  font-size: 0.98rem;
  font-weight: 600;
  background: var(--color-accent);
  color: #ffffff;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  transform: translateY(0);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.45);
}

.cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
  filter: brightness(0.96);
}

.cta.light {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid #d1d5db;
  box-shadow: none;
}

.cta.light:hover {
  background: rgba(243, 244, 246, 0.95);
}

/* Dark mode – outlined CTA stays readable */
body.dark .cta.light {
  /* Keep it as an outline button on dark background */
  background: transparent;
  color: var(--color-text-main);              /* light text */
  border-color: rgba(148, 163, 184, 0.8);     /* slightly stronger border */
}

/* Dark mode hover: darker pill, still high contrast */
body.dark .cta.light:hover {
  background: rgba(15, 23, 42, 0.95);         /* deep navy pill */
  color: var(--color-text-main);              /* stay light text */
  border-color: rgba(148, 163, 184, 1);       /* a bit crisper on hover */
}

/* GENERIC SECTIONS */

.section {
  padding: 4.5rem 1.5rem 5rem;
}

.section-title {
  font-size: clamp(1.8rem, 2.4vw, 2.1rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-intro {
  max-width: 580px;
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 2.2rem;
}

/* =========================================================
   DETAIL PAGES (case studies, Work With Me)
   ---------------------------------------------------------
   Applies to any page whose <body> has class="page-detail".
   Keeps things narrower, with a soft hero card at the top
   so it feels consistent with the main hero.
   ========================================================= */

body.page-detail .section {
  /* Slightly tighter vertical rhythm than homepage sections */
  padding-block: 3.2rem 3.6rem;
}

/* First section = hero-style card */
body.page-detail .section:first-of-type {
  margin-top: 2rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.12), transparent 55%),
    var(--color-surface);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.12);
}

/* Dark-mode version of that hero card */
body.dark.page-detail .section:first-of-type {
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.18), transparent 65%),
    radial-gradient(circle at 80% 100%, rgba(244, 114, 182, 0.16), transparent 65%),
    rgba(2, 6, 23, 0.96);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.7),
    0 0 120px rgba(56, 189, 248, 0.12);
}

/* Make the very first heading feel a bit more "hero" */
body.page-detail .section:first-of-type .section-title {
  font-size: clamp(2.1rem, 3vw, 2.6rem);
}

/* Detail-page lists: vertical, calm, readable */
.detail-list {
  list-style: disc;
  padding-left: 1.3rem;
  margin-bottom: 1.6rem;
  font-size: 0.96rem;
  color: var(--color-text-muted);
}

.detail-list li + li {
  margin-top: 0.25rem;
}

/* Detail page blocks: wide centered card sections, closer to hero width */
body.page-detail .detail-block {
  background: var(--color-surface);
  border-radius: 22px;
  padding: 2.4rem 2.6rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.22);
  max-width: 960px;        /* wider, closer to hero width */
  margin-left: auto;
  margin-right: auto;       /* always centered */
}

/* Keep these classes for semantics / future tweaks,
   but visually they all behave the same for now. */
body.page-detail .detail-block--left,
body.page-detail .detail-block--right,
body.page-detail .detail-block--center {
  margin-left: auto;
  margin-right: auto;
}

/* Keep spacing consistent between sections on detail pages */
body.page-detail .section + .section {
  margin-top: 0.5rem;
}

/* Dark-mode variants for detail blocks */
body.dark.page-detail .detail-block {
  background: rgba(2, 6, 23, 0.96);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.7),
    0 0 45px rgba(56, 189, 248, 0.05);
}
/*
 * SCROLL REVEAL
 * -------------
 * Elements with `.reveal` start slightly faded and moved down.
 * When JS adds `.is-visible`, they animate into place.
 */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* Tiny stagger for service cards */
.services .service-card.reveal:nth-child(1) {
  transition-delay: 0.0s;
}
.services .service-card.reveal:nth-child(2) {
  transition-delay: 0.06s;
}
.services .service-card.reveal:nth-child(3) {
  transition-delay: 0.12s;
}

/* Tiny stagger for project cards */
.projects-grid .project-card.reveal:nth-child(1) {
  transition-delay: 0.0s;
}
.projects-grid .project-card.reveal:nth-child(2) {
  transition-delay: 0.06s;
}
.projects-grid .project-card.reveal:nth-child(3) {
  transition-delay: 0.12s;
}

/* Tiny stagger for about-side blocks */
.about-side .about-block.reveal:nth-child(1) {
  transition-delay: 0.0s;
}
.about-side .about-block.reveal:nth-child(2) {
  transition-delay: 0.06s;
}

/* Section-specific reveal nuances */

/* About main: slide from left → settle at center */
.section.about .about-main.reveal {
  transform: translateX(-24px);
}
.section.about .about-main.reveal.is-visible {
  transform: translateX(0);
}

/* About side blocks: slide from right → settle at center */
.section.about .about-block.reveal {
  transform: translateX(24px);
}
.section.about .about-block.reveal.is-visible {
  transform: translateX(0);
}
/* Hero: just fade in (no vertical slide) */
.hero.reveal {
  transform: none;
}

/* About main: clearer slide from the left → settle at center */
.section.about .about-main.reveal {
  transform: translateX(-32px);
}
.section.about .about-main.reveal.is-visible {
  transform: translateX(0);
}

/* About side blocks: clearer slide from the right → settle at center */
.section.about .about-block.reveal {
  transform: translateX(32px);
}
.section.about .about-block.reveal.is-visible {
  transform: translateX(0);
}

/* GRID CARDS */

.cards-grid {
  display: grid;
  gap: 2rem;
}

.cards-grid.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/*
 * SERVICES SECTION
 * -----------------
 * Three simple service cards that explain what you offer.
 * This section reuses the generic `.section` spacing and the shared card style.
 */
/* SERVICES */

/* Wrapper for the services section grid – keeps things consistent */
 /* On desktop, cards naturally form up to 3 columns because of max-width.
     We keep this rule in case we later want a fixed column count. */


.service-card {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.2);
  /* Stack icon, title and text with comfortable vertical spacing */
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Circular icon badge at the top of each service card */
.service-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
  /* Soft accent background to keep focus on the text */
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-accent);
}

/* Dark-mode version of the service icon background */
body.dark .service-icon {
  background: rgba(15, 23, 42, 0.9);
}

/*
 * PROJECTS SECTION
 * -----------------
 * A grid of project cards showing practice work and real layouts.
 * `.cards-grid.projects-grid` defines the responsive column behavior.
 */
/* PROJECTS */

/* Slightly tighter intro spacing for projects so the grid feels connected */
.projects .section-intro {
  margin-bottom: 1.8rem;
}

.project-card {
  background: var(--color-surface);
  padding: 1.9rem 1.7rem;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform-origin: center top;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Featured project spans two columns on larger screens to feel like a case study */
.project-card.project-card--featured {
  grid-column: span 2;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.5);
}

/* Shared card base: allows inner overlays like vignettes */
.service-card,
.project-card,
.about-block {
  position: relative;   /* so ::before sits inside the card */
  overflow: hidden;     /* hide the vignette at the rounded corners */
}

.project-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.project-description {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.project-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.project-meta li {
  padding-left: 0.9rem;
  position: relative;
}

.project-meta li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
}

.project-links {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.project-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

.project-soon {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/*
 * ABOUT SECTION
 * --------------
 * Two-column layout: main text on the left, quick facts on the right.
 * On smaller screens, the `@media (max-width: 900px)` rule stacks it.
 */
/* ABOUT */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.5rem;
}

/* Limit the width of the main about text for better readability */
.about-main {
  max-width: 640px;
}

.about p {
  font-size: 0.98rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-block {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.about-block h3 {
  font-size: 0.98rem;
  margin-bottom: 0.6rem;
}

.about-block ul {
  list-style: none;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.about-block li + li {
  margin-top: 0.25rem;
}

/*
 * CONTACT SECTION
 * ----------------
 * Final CTA: email, a secondary CTA, and a short note with links.
 */
/* CONTACT */

.contact {
  text-align: left;
}

/* Keep contact intro text from stretching too wide */
.contact .section-intro {
  max-width: 540px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.contact-note {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.contact-note a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact-note a:hover {
  text-decoration: underline;
}

/* FOOTER */

.footer {
  padding: 2rem 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 2.5rem;
}

/* DARK MODE */

body.dark {
  --color-bg: #020617;
  --color-surface: #020617;
  --color-primary: #e5e7eb;
  --color-accent: #38bdf8;
  --color-text-main: #e5e7eb;
  --color-text-muted: #9ca3af;
  background: radial-gradient(
      circle at 30% 10%,
      rgba(99, 102, 241, 0.15),
      transparent 60%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(236, 72, 153, 0.12),
      transparent 65%
    ),
    radial-gradient(
      circle at center,
      rgba(56, 189, 248, 0.10),
      transparent 70%
    ),
    #020617;
}

body,
.hero,
.service-card,
.project-card,
.about-block {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Prevent gradient/light bleed across borders in dark mode */
body.dark .section,
body.dark .hero,
body.dark .service-card,
body.dark .project-card,
body.dark .about-block {
  background-clip: padding-box;
}

/*
 * DARK MODE SECTION CONTRAST
 * --------------------------
 * Give each major section a slightly different feel in dark mode so
 * the page has depth and separation instead of one flat dark color.
 */

/* Premium hero glow — deep gradient + subtle spotlight */
body.dark .hero {
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.20), transparent 65%),
    radial-gradient(circle at 80% 100%, rgba(244, 114, 182, 0.18), transparent 65%),
    rgba(2, 6, 23, 0.9);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.6),
    0 0 140px rgba(56, 189, 248, 0.12),
    0 0 180px rgba(244, 114, 182, 0.10);
}

/* Navbar: slightly lighter surface so it reads as a floating pill */
body.dark .navbar {
  background-color: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.9);
}

/* Dark-mode cards: soft edges + gentle glow */
body.dark .service-card,
body.dark .project-card,
body.dark .about-block {
  /* Close to page bg so there’s no hard rectangle edge */
  background: rgba(2, 6, 23, 0.96);

  /* Very soft border so the line almost disappears */
  border: 1px solid rgba(148, 163, 184, 0.14);

  /* Subtle depth + slight cyan glow */
  box-shadow:
    0 16px 45px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(56, 189, 248, 0.04);
}

/* Subtle inward vignette on dark cards */
body.dark .service-card::before,
body.dark .project-card::before,
body.dark .about-block::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  /* Soft, inward shadow so edges fade instead of having a line */
  box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.65);
  opacity: 0.55; /* tweak between 0.3–0.6 until it feels right */
}

/* Footer: clearer top border so it still feels separated from the page */
body.dark .footer {
  border-top-color: rgba(51, 65, 85, 0.9);
}

/* Section ambient glow — soft Dribbble haze */
body.dark .section {
  position: relative;
}

body.dark .section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center top,
    rgba(56, 189, 248, 0.12),
    transparent 70%
  );
  opacity: 0.35;
  z-index: -1;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .navbar {
    padding: 0.75rem 1.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .section {
    padding-inline: 1.2rem;
  }

  .cards-grid.projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* On tablets/phones, featured projects behave like normal cards */
  .project-card.project-card--featured {
    grid-column: span 1;
  }

  .about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    font-size: 0.9rem;
  }

  .hero {
    padding: 3.2rem 1.2rem 3.6rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards-grid.projects-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-inline: 1.1rem;
  }

    /* MOBILE NAVBAR – more compact */
  .navbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: 0.4rem;
    padding: 0.65rem 0.9rem 0.8rem;
    border-radius: 22px;
  }

  /* Logo on the left, one line */
  .logo {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    text-align: left;
  }

  .logo-main {
    font-size: 0.9rem;
  }

  .logo-sub {
    display: none; /* optional on mobile */
  }

  /* Theme toggle on the right */
  .theme-toggle {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
    transform: scale(0.9);
    margin-top: 0;
  }

  /* Nav links in the second row */
  .nav-links {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    font-size: 0.85rem;
    text-align: center;
  }
  
/* Theme toggle stays to the right */
.theme-toggle {
  align-self: flex-end;
  margin-top: 0.3rem;
}

}