/* =========================================================
   Ana Aviles — site styles
   Palette and type follow mockup.png: near-black canvas,
   red-orange for action, yellow for the pull-quote band,
   warm off-white "paper" sections for breathing room.
   ========================================================= */

:root {
  --bg: #0d0d0f;
  --bg-elev: #17171b;
  --bg-elev-2: #202027;
  --ink: #f5f3ef;
  --muted: #a5a29c;
  --line: #2c2c33;

  --accent: #e04a2f;
  --accent-hot: #f05a3c;
  --yellow: #f2c230;

  --paper: #f5f3ef;
  --paper-ink: #17171a;
  --paper-muted: #56545o;
  --paper-muted: #5a5854;
  --paper-line: #ddd9d1;

  --display: "Archivo Black", "Arial Black", sans-serif;
  --script: "Dancing Script", cursive;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  /* width/height attributes are set for layout stability, so scale height with it */
  height: auto;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}

.wordmark {
  font-family: var(--script);
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 2.2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 26px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

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

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hot);
}

.btn--ghost {
  border-color: currentColor;
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn--dark {
  background: #111;
  color: #fff;
}
.btn--dark:hover {
  background: #000;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* Text link with the mockup's underline-accent treatment */
.link-arrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
  transition: gap 0.15s ease;
}
.link-arrow::after {
  content: " →";
}
.link-arrow:hover {
  border-bottom-color: currentColor;
}

/* ---------------- Section furniture ---------------- */

.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
}

.section--paper {
  background: var(--paper);
  color: var(--paper-ink);
}
.section--paper .eyebrow {
  color: var(--accent);
}

.section--elev {
  background: var(--bg-elev);
}

.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: 1rem;
}

.lede {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--muted);
  max-width: 60ch;
}
.section--paper .lede {
  color: var(--paper-muted);
}

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

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
}

.hero .lede {
  margin-top: 1.75rem;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  max-width: 42ch;
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  /* Source photos are tall phone shots; without a cap they dwarf the headline. */
  max-height: min(78vh, 620px);
  object-fit: cover;
  object-position: center 28%;
  border-radius: var(--radius);
}

/* Thin accent rule that echoes the book cover's red underline */
.hero-media::after {
  content: "";
  position: absolute;
  left: -14px;
  bottom: -14px;
  width: 45%;
  height: 6px;
  background: var(--accent);
}

/* Page hero (interior pages) */
.page-hero {
  padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
}
.page-hero .lede {
  margin-top: 1.5rem;
}

/* ---------------- Yellow quote band ---------------- */

.quote-band {
  background: var(--yellow);
  color: #14140f;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.quote-band p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3.4vw, 2.4rem);
  line-height: 1.32;
  max-width: 24ch;
  margin-inline: auto;
  text-wrap: balance;
}

@media (min-width: 700px) {
  .quote-band p {
    max-width: 34ch;
  }
}

/* ---------------- Card grid (pillars / projects) ---------------- */

.grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

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

.card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__media img {
  transform: scale(1.04);
}

.card__body {
  padding: 1.5rem 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__title {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.card__text {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.card__cue {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}
.card__cue::after {
  content: " →";
}

/* ---------------- Split feature (image + text) ---------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.split--flip .split__media {
  order: 2;
}

.split__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.split__media--tall img {
  aspect-ratio: 3 / 4;
}

/* ---------------- Book feature (red block) ---------------- */

.book-block {
  background: var(--accent);
  color: #fff;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.book-block__inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.book-block h2 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
}

.book-block p {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 52ch;
}

.book-cover {
  max-width: 330px;
  width: 100%;
  margin-inline: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  transform: rotate(-2deg);
  transition: transform 0.3s ease;
}
.book-cover:hover {
  transform: rotate(0deg) translateY(-6px);
}

.book-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ---------------- Full-bleed image band ---------------- */

.band {
  position: relative;
  min-height: clamp(420px, 60vh, 640px);
  display: grid;
  align-items: end;
  background-size: cover;
  background-position: center;
}

.band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(8, 8, 10, 0.94) 0%,
    rgba(8, 8, 10, 0.6) 45%,
    rgba(8, 8, 10, 0.25) 100%
  );
}

.band__content {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 46rem;
}

.band__content h2 {
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  margin-bottom: 1rem;
}

/* ---------------- Stat / value rows ---------------- */

.facts {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.section--paper .facts {
  border-color: var(--paper-line);
}

.facts dt,
.facts .facts__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.facts .facts__value {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.3;
}

/* ---------------- Prose (blog posts, long text) ---------------- */

.prose {
  max-width: 68ch;
}

.prose h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 2.5em;
  margin-bottom: 0.6em;
}

.prose h3 {
  font-size: 1.25rem;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 4px solid var(--accent);
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
}
.section--paper .prose blockquote {
  color: var(--paper-ink);
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
  margin-bottom: 1.2em;
}
.prose li {
  margin-bottom: 0.4em;
}

.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* ---------------- Photo grid ---------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.photo-grid figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.section--paper .photo-grid figcaption {
  color: var(--paper-muted);
}

.photo-grid__wide {
  grid-column: span 2;
}

/* ---------------- Post list ---------------- */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  border-top: 1px solid var(--line);
}
.post-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.post-link {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 2rem;
  align-items: baseline;
  padding: 2rem 0;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.post-link:hover {
  opacity: 0.7;
}

.post-date {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-title {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
}

.post-excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
}

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

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.contact-email {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3.4vw, 2.2rem);
  text-decoration: none;
  color: var(--accent);
  word-break: break-word;
  display: inline-block;
  margin-bottom: 2rem;
}
.contact-email:hover {
  color: var(--ink);
}

.social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.social-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.social-list a::after {
  content: "↗";
  color: var(--accent);
}
.social-list a:hover {
  border-color: var(--accent);
  background: var(--bg-elev);
}

/* ---------------- CTA strip ---------------- */

.cta-strip {
  background: var(--bg-elev-2);
  padding-block: clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.cta-strip h2 {
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  margin-bottom: 1rem;
}

.cta-strip .lede {
  margin-inline: auto;
  margin-bottom: 2rem;
}

.cta-strip .btn-row {
  justify-content: center;
}

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

.site-footer {
  background: #08080a;
  border-top: 1px solid var(--line);
  padding-top: clamp(3rem, 6vw, 4.5rem);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.footer-nav ul,
.social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.footer-nav a,
.social a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-nav a:hover,
.social a:hover {
  color: var(--ink);
}

.footer-email {
  display: inline-block;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 1.25rem;
  word-break: break-word;
}

.footer-legal {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem;
}
.footer-legal p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .post-link {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 780px) {
  body {
    font-size: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  /* backdrop-filter makes the header a containing block for fixed children,
     which would trap the full-screen menu inside the 74px bar. */
  .site-header {
    backdrop-filter: none;
    background: var(--bg);
  }

  /* Off-canvas via opacity rather than translateX(100%): a panel parked one
     viewport to the right widens the document and breaks the layout. */
  .site-nav {
    position: fixed;
    inset: 74px 0 0;
    z-index: 60;
    background: var(--bg);
    padding: 2rem var(--gutter);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    overflow-y: auto;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    display: block;
    font-size: 1.35rem;
    font-family: var(--display);
    color: var(--ink);
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }
  .site-nav a[aria-current="page"] {
    color: var(--accent);
  }

  /* Hamburger -> X */
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  body.nav-open {
    overflow: hidden;
  }

  .hero-inner,
  .split,
  .book-block__inner,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-media {
    order: -1;
  }
  .hero-media img {
    aspect-ratio: 3 / 2;
  }

  .split--flip .split__media {
    order: 0;
  }

  .book-cover {
    max-width: 260px;
    margin-inline: auto;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 560px) {
  .grid--3,
  .grid--2,
  .photo-grid {
    grid-template-columns: 1fr;
  }
  .photo-grid__wide {
    grid-column: span 1;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
