/* =========================================================
   COLORS
   Every color on the site lives here. Light mode is the default;
   the [data-theme="dark"] block swaps in the dark values.
   ========================================================= */
:root {
  --color-bg: #fbf7f2;          /* warm off-white page background */
  --color-surface: #ffffff;     /* cards */
  --color-text: #1f1a17;        /* main text */
  --color-text-muted: #6b625b;  /* secondary text */
  --color-border: #e8dfd5;
  --color-accent: #11504f;      /* spruce */
  --color-accent-hover: #0b3a39;
  --color-accent-soft: #dcefed; /* pale tint of the accent, for tags */
  --color-on-accent: #ffffff;   /* text sitting on the accent color */
  --color-nav-bg: #11504f;      /* nav band: stays spruce in both modes */
  --color-on-nav: #ffffff;      /* text and icons on the nav band */
  --color-nav-hover: rgba(255, 255, 255, 0.15);  /* light tint behind hovered nav items */
  --color-nav-border: rgba(255, 255, 255, 0.45); /* outline of the toggle button */
  --color-placeholder-bg: #fff3c4;
  --color-placeholder-text: #6a5300;
  --shadow: 0 1px 2px rgba(31, 26, 23, 0.06), 0 8px 24px rgba(31, 26, 23, 0.06);

  /* Font: Manrope, with system fonts as a fallback while it loads */
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

[data-theme="dark"] {
  --color-bg: #171311;
  --color-surface: #221d1a;
  --color-text: #f4ede6;
  --color-text-muted: #b3a89f;
  --color-border: #3a322d;
  --color-accent: #6fc8bd;      /* lighter spruce, readable on the dark background */
  --color-accent-hover: #9bdad2;
  --color-accent-soft: #12302f;
  --color-on-accent: #1a0f0a;
  --color-placeholder-bg: #3a3214;
  --color-placeholder-text: #f3dc8a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);

  color-scheme: dark;
}

/* =========================================================
   BASE
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* so jumped-to sections aren't hidden under the sticky nav */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3 {
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; }

button { font: inherit; }

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 48rem) {
  .container { padding-inline: 2rem; }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; }

/* =========================================================
   NAV
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-nav-bg);
  color: var(--color-on-nav);
}

/* Keyboard focus rings in the nav are white so they show on the spruce band */
.site-header :focus-visible { outline-color: var(--color-on-nav); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.nav__name {
  font-weight: 800; /* Manrope's heaviest */
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav__links {
  display: flex;
  gap: 0.25rem;
}

.nav__links a {
  display: block;
  padding: 0.5rem 0.6rem;
  font-weight: 500; /* lighter than the name, so the name stands out */
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 6px;
}

/* Hover: a light tint behind the link plus an underline */
.nav__links a:hover {
  background: var(--color-nav-hover);
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
}

.nav__name:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 2px;
}

/* Tighten the nav on small phones so everything fits on one line */
@media (max-width: 26rem) {
  .nav__right { gap: 0.4rem; }
  .nav__links { gap: 0; }
  .nav__links a { padding: 0.5rem 0.4rem; font-size: 0.9rem; }
  .nav__name { font-size: 1.1rem; }
}

.theme-toggle {
  position: relative; /* anchors the tooltip */
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-nav-border);
  border-radius: 50%;
  background: transparent;
  color: var(--color-on-nav);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--color-nav-hover);
  border-color: var(--color-on-nav);
}

/* The button shows the mode it switches TO: a moon in light mode, a sun in dark mode */
.theme-toggle__icon {
  width: 1.2rem;
  height: 1.2rem;
}

.theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .theme-toggle__icon--sun { display: block; }
[data-theme="dark"] .theme-toggle__icon--moon { display: none; }

/* Tooltip: appears below the button on mouse hover or keyboard focus */
.theme-toggle__tooltip {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-bg);
  background: var(--color-text);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.theme-toggle:focus-visible .theme-toggle__tooltip { opacity: 1; }

/* Only on devices with a real mouse, so it doesn't get stuck on after a tap */
@media (hover: hover) {
  .theme-toggle:hover .theme-toggle__tooltip { opacity: 1; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding-block: 4rem 3rem;
}

@media (min-width: 48rem) {
  .hero { padding-block: 7rem 5rem; }
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.hero__headline {
  font-size: clamp(2.4rem, 7vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 18ch;
}

/* Short spruce bar under the headline */
.hero__headline::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 0.4rem;
  margin-top: 1.75rem;
  background: var(--color-accent);
  border-radius: 999px;
}

.hero__intro {
  margin-top: 1.5rem;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--color-text-muted);
  max-width: 40rem;
}

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

@media (min-width: 48rem) {
  .proof { grid-template-columns: repeat(3, 1fr); }
}

.proof__item {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent); /* spruce marker on each proof point */
  border-radius: 12px;
}

.proof__label {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.proof__item p { color: var(--color-text-muted); }

/* =========================================================
   SECTIONS
   ========================================================= */
.section {
  padding-block: 3.5rem;
  border-top: 1px solid var(--color-border);
}

@media (min-width: 48rem) {
  .section { padding-block: 5rem; }
}

.section__title {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 2rem;
}

/* =========================================================
   WORK CARDS
   ========================================================= */
.work-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .work-grid { grid-template-columns: 2fr 1fr; }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card--featured {
  padding: 2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 48rem) {
  .card--featured { padding: 3rem; min-height: 22rem; }
}

.card--featured:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.card--upcoming {
  box-shadow: none;
  border-style: dashed;
}

.card__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
}

.card--upcoming .card__title { font-size: 1.5rem; }

.card__text {
  color: var(--color-text-muted);
  max-width: 36rem;
}

.card__cta {
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 700;
  color: var(--color-accent);
}

.card--featured:hover .card__cta { color: var(--color-accent-hover); }

.card__note {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.tag {
  align-self: flex-start;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: 999px;
}

.tag--muted {
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
}

/* =========================================================
   ABOUT & CONTACT
   ========================================================= */
.about__text,
.contact__lead {
  font-size: 1.2rem;
  max-width: 42rem;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--color-text);
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.button--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.button--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-on-accent);
}

/* Small inline note showing which link still needs a real URL. Delete once filled in. */
.placeholder-note {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
