/* ==========================================================================
   index.css — portfolio homepage
   Art direction (settled, see STAGE 2 comment in index.html):
   Palette: bg #141210 / surface #211c17 / text #ece7df / muted #a89f93 /
   accent #e8825a (warm orange, no blue or purple-indigo anywhere).
   Type: display "Sora" / body "Source Sans 3" with offline-safe fallbacks;
   scale 0.875 / 1 / 1.125 / 1.5 / 2.25 / 3.5 rem only.
   Motion: dropdown 150ms, card hover 200ms, CTA press 150ms, hero fade-in
   300ms; all disabled under prefers-reduced-motion: reduce.
   ========================================================================== */

:root {
  --bg: #141210;
  --surface: #211c17;
  --text: #ece7df;
  --muted: #a89f93;
  --accent: #e8825a;
  --accent-bright: #f2976f;
  --tint-accent: #35261e;      /* surface with accent tint */
  --tint-soft: rgba(232, 130, 90, 0.12);
  --line: rgba(236, 231, 223, 0.08);
  --line-strong: rgba(236, 231, 223, 0.16);
  --display: "Sora", system-ui, "Segoe UI", sans-serif;
  --body: "Source Sans 3", system-ui, "Segoe UI", sans-serif;
  --container: 1120px;
  --radius-card: 12px;
  --radius-square: 8px;
}

/* Reset ------------------------------------------------------------------- */

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

html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem;
  font-family: var(--display);
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: 3.5rem;  font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem;  font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 1rem;     font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

p {
  margin: 0 0 1rem;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--accent-bright);
}

a:focus-visible,
.nav-label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover {
  color: var(--accent);
}

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

.nav-item {
  position: relative;
}

.nav-item > a,
.nav-label {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease;
}

.nav-item > a:hover,
.nav-item:focus-within > a,
.nav-item:focus-within > .nav-label,
.nav-label:hover {
  color: var(--accent);
}

/* Dropdown panels: CSS-only via :hover / :focus-within -------------------- */

.dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 20;
  min-width: 220px;
  max-width: min(320px, 100vw);
  padding: 0.5rem;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: visibility 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown {
  visibility: visible;
  opacity: 1;
  transform: none;
}

/* Keep the right-side panel inside the viewport */
.nav-item-right .dropdown {
  left: auto;
  right: 0;
}

.dropdown li {
  margin: 0;
}

.dropdown a,
.dropdown .group-label {
  display: block;
  padding: 0.4375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  border-radius: var(--radius-square);
}

.dropdown a:hover {
  color: var(--accent);
  background: var(--tint-soft);
}

.dropdown li > ul {
  margin: 0;
  padding-left: 0.75rem;
}

.group-label {
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: default;
}

.group-label:hover {
  color: var(--muted);
  background: none;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
  animation: hero-in 300ms ease both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero h1 {
  max-width: 18ch;
  margin-bottom: 1rem;
}

.hero h1::after {
  content: "";
  display: block;
  width: 5rem;
  height: 0.375rem;
  margin-top: 1rem;
  background: var(--accent);
  border-radius: 999px;
}

.role {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.bio {
  font-size: 1.125rem;
  max-width: 56ch;
  color: var(--text);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color 150ms ease, border-color 150ms ease,
    color 150ms ease, transform 150ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-bright);
  color: var(--bg);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* About band (full-bleed surface) ------------------------------------------ */

.about-band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4rem 1.5rem;
}

.about-band h2 {
  max-width: var(--container);
  margin: 0 auto 2rem;
}

.xp {
  max-width: var(--container);
  margin: 0 auto 2rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
}

.about-band .xp:last-child {
  margin-bottom: 0;
}

.xp h3 {
  margin-bottom: 0.25rem;
}

.xp-role {
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.xp p {
  color: var(--muted);
  margin-bottom: 0;
}

/* Featured grid ------------------------------------------------------------ */

.featured {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.featured h2 {
  margin-bottom: 2rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

.feature-card h3 {
  margin-bottom: 0;
  font-size: 1.5rem;
}

.feature-card h3 a {
  color: var(--text);
}

.feature-card h3 a:hover {
  color: var(--accent);
}

.feature-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.card-wide {
  grid-column: span 4;
}

.card-accent {
  grid-column: span 2;
  background: var(--tint-accent);
}

.card-tint {
  grid-column: span 2;
  background: var(--bg);
  border-color: var(--line-strong);
}

.card-image {
  grid-column: span 4;
  background: var(--tint-soft);
  border-color: var(--line);
}

.card-image > a {
  display: block;
}

.card-image img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-square);
}

/* Monograms: display face, accent, 3.5rem --------------------------------- */

.monogram {
  align-self: flex-start;
  font-family: var(--display);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* Single-letter monograms sit in a square tile (8px radius) */
.card-accent .monogram,
.card-tint .monogram {
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  background: var(--tint-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-square);
}

/* Project index ------------------------------------------------------------- */

.index {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.index h2 {
  margin-bottom: 2rem;
}

.project-index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
}

.project-index li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}

.project-index a {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-index a:hover {
  color: var(--accent);
}

.project-index p {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.project-index .no-link {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.thumb {
  float: right;
  width: 4rem;
  height: 4rem;
  margin-left: 1rem;
  object-fit: cover;
  border-radius: var(--radius-square);
}

/* Contact ------------------------------------------------------------------- */

.contact {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem 4.5rem;
}

.contact h2 {
  margin-bottom: 1rem;
}

.contact > p {
  max-width: 56ch;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
}

.socials a {
  font-size: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  transition: color 150ms ease, border-color 150ms ease;
}

.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Footer ---------------------------------------------------------------------- */

.site-footer {
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* Mobile ----------------------------------------------------------------------- */

@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
  }

  .nav-item {
    position: static;
    width: 100%;
  }

  .nav-item > a,
  .nav-label {
    display: block;
    width: 100%;
    padding: 0.5rem 0.25rem;
  }

  /* Collapsed by default: tap (focus) or hover the parent item to open */
  .dropdown {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0 0 0.5rem 0.25rem;
    padding: 0.25rem 0 0.25rem 1rem;
    background: transparent;
    border: 0;
    border-left: 2px solid var(--line-strong);
    border-radius: 0;
    box-shadow: none;
  }

  .nav-item:hover > .dropdown,
  .nav-item:focus-within > .dropdown {
    display: block;
  }

  .dropdown a,
  .dropdown .group-label {
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-square);
  }

  .dropdown li > ul {
    padding-left: 1rem;
  }

  .hero {
    padding: 3rem 1.5rem 2.5rem;
  }

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

  .card-wide,
  .card-accent,
  .card-tint,
  .card-image {
    grid-column: auto;
  }

  .card-accent .monogram,
  .card-tint .monogram {
    width: 4.5rem;
    height: 4.5rem;
  }

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

/* Reduced motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
