/* ==========================================================================
   Thomas Quintero — portfolio styles
   Palette: "Canyon & Caliche" (earth tones, light ground)
   Mobile-first: base styles are for phones; min-width queries scale up.
   ========================================================================== */

/* ---------- fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("../assets/fonts/karla-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* ---------- design tokens ---------- */
:root {
  /* color */
  --paper:      #F2EDE3;   /* limestone — page ground */
  --paper-deep: #E9E2D2;   /* darker band for alternating sections */
  --ink:        #2E2418;   /* umber — headings, body */
  --ink-soft:   #5C4F3D;   /* secondary text */
  --rust:       #B0532A;   /* canyon rust — CTAs, accents */
  --rust-deep:  #8F421F;   /* CTA hover */
  --sage:       #77804F;   /* juniper sage — supporting accent */
  --line:       #DCD2BE;   /* caliche — borders, rules */
  --card:       #FBF8F1;   /* card surface */

  /* type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Karla", -apple-system, "Segoe UI", sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* rhythm */
  --nav-height: 64px;
  --section-pad: clamp(64px, 10vw, 112px);
  --content-width: 1120px;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 8px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

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

img, video { max-width: 100%; display: block; }

a { color: var(--rust); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 2px;
}

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 18px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.1;
  margin: 0 0 16px;
  text-wrap: balance;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border-radius: 6px;
  padding: 14px 30px;
  transition: background-color 160ms ease, transform 160ms ease;
}
.btn-primary {
  background: var(--rust);
  color: var(--paper);
}
.btn-primary:hover { background: var(--rust-deep); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

/* ==========================================================================
   NAV
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
/* solid ground once the page scrolls */
.site-nav.scrolled {
  background: rgba(242, 237, 227, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--line);
}

.nav-inner {
  max-width: var(--content-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}

/* links: dropdown panel on mobile, inline row on desktop */
.nav-links {
  position: absolute;
  top: var(--nav-height);
  left: 12px; right: 12px;
  display: none;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(46, 36, 24, 0.14);
}
.site-nav.open .nav-links { display: flex; }
.site-nav.open { background: var(--paper); box-shadow: 0 1px 0 var(--line); }

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 6px;
}
.nav-links a:hover { background: var(--paper-deep); }
.nav-links a.nav-contact { color: var(--rust); font-weight: 700; }

/* hamburger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle .bar {
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 200ms ease;
}
.site-nav.open .nav-toggle .bar:first-child { transform: translateY(4px) rotate(45deg); }
.site-nav.open .nav-toggle .bar:last-child  { transform: translateY(-4px) rotate(-45deg); }

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .nav-links {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }
  .nav-links a { padding: 8px 14px; font-size: 15px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--nav-height) + 32px) 20px 64px;
}

.hero-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

/* portrait sits beside the text on wide screens, below it on phones */
.hero-portrait {
  margin: 0;
  align-self: center;
  width: min(72vw, 320px);
}
/* tilt lives on the svg so the reveal transform on the figure can't undo it */
.hero-portrait svg {
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(6deg);            /* the "at an angle" ask */
  filter: drop-shadow(0 14px 24px rgba(46, 36, 24, 0.18));
}

@media (min-width: 900px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
  }
  .hero-text { flex: 1 1 auto; }
  .hero-portrait { flex: 0 0 400px; width: 400px; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(44px, 9vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  max-width: 12ch;
}

.hero-sub {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 36px;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding: var(--section-pad) 20px; }
.section-inner { max-width: var(--content-width); margin: 0 auto; }

.section-kicker {
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 0 44px;
}

/* ==========================================================================
   PROJECT CARDS
   ========================================================================== */
.section-projects {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 680px)  { .project-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .project-grid { grid-template-columns: 1fr 1fr 1fr; } }

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
/* hover on pointers, focus-within for keyboards — no hover dependency */
.pcard:hover,
.pcard:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(46, 36, 24, 0.14);
}

.pcard-media {
  aspect-ratio: 16 / 10;
  background: var(--paper-deep);
  overflow: hidden;
}
.pcard-media img,
.pcard-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.pcard:hover .pcard-media img,
.pcard:hover .pcard-media video { transform: scale(1.03); }

/* placeholder shown when a media file hasn't been added yet */
.pcard-media.media-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    repeating-linear-gradient(-35deg,
      transparent 0 22px, rgba(160, 145, 116, 0.16) 22px 23px),
    var(--paper-deep);
}
.media-initial {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 64px;
  line-height: 1;
  color: var(--sage);
}
.media-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pcard-body {
  display: flex;
  flex-direction: column;
  flex: 1;                 /* keeps links bottom-aligned across the row */
  padding: 22px 24px 24px;
}
.pcard-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 10px;
  text-wrap: balance;
}
.pcard-desc {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.pcard-link {
  margin-top: auto;
  font-weight: 700;
  font-size: 15px;
  color: var(--rust);
  text-decoration: none;
}
.pcard-link:hover { text-decoration: underline; }

/* ==========================================================================
   SCROLL REVEALS
   Elements tagged data-reveal slide/fade in when they enter the viewport
   (js/main.js adds .revealed). The hidden initial state only exists for
   users who are okay with motion — everyone else sees content immediately.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transition: opacity 650ms ease, transform 650ms cubic-bezier(0.22, 0.9, 0.3, 1);
  }
  [data-reveal="left"]  { transform: translateX(-48px); }
  [data-reveal="right"] { transform: translateX(48px); }
  [data-reveal="up"]    { transform: translateY(26px); }
  [data-reveal].revealed { opacity: 1; transform: none; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1.7fr 1fr; align-items: start; }
}

.about-prose p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.about-prose p:first-of-type { color: var(--ink); }

/* quick facts: a survey-legend style card */
.about-facts dl {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 24px 26px;
}
.about-facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  margin-top: 16px;
}
.about-facts dt:first-child { margin-top: 0; }
.about-facts dd { margin: 3px 0 0; font-size: 15.5px; }

/* ==========================================================================
   SKILLS
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 820px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }

.skill-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 26px 28px;
}
.skill-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 18px;
}
.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-list li {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--paper);
}
/* pills give a small spring when pointed at */
@keyframes chip-bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-7px); }
  55%  { transform: translateY(2px); }
  75%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
.chip-list li:hover {
  animation: chip-bounce 480ms ease;
  border-color: var(--sage);
  color: var(--ink);
}

/* ==========================================================================
   EXPERIENCE TIMELINE
   Mobile-first: vertical rail with expandable rows. On wide screens the
   same DOM becomes a horizontal track of stops with a shared detail
   panel row beneath. All interaction is click/tap on <button>s.
   ========================================================================== */
/* experience now sits on plain paper between two deep bands */
.section-skills {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
}

.timeline { position: relative; }

/* rust progress line that fills along the rail as the visitor scrolls;
   geometry mirrors the .timeline::before rail in both layouts */
.tl-progress {
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--rust);
  transform: scaleY(0);
  transform-origin: top;
  will-change: transform;
}

/* stops start dim and light up as the progress line reaches them */
.tl-stop { opacity: 0.35; transition: opacity 450ms ease; }
.tl-stop.lit { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tl-stop { opacity: 1; }
  .tl-progress { display: none; }
}

/* the connecting rail (vertical on mobile) */
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--line);
}

.tl-stop {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 14px 8px 14px 40px;
  border-radius: 8px;
}
.tl-stop:hover .tl-org { color: var(--rust); }

.tl-dot {
  position: absolute;
  left: 0;
  top: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.tl-stop[aria-expanded="true"] .tl-dot {
  background: var(--rust);
  border-color: var(--rust);
}
.tl-stop[aria-expanded="true"] .tl-org { color: var(--rust); }

.tl-dates {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.tl-org {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  transition: color 150ms ease;
}
.tl-role {
  display: block;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.tl-panel {
  margin: 2px 0 14px 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: 8px;
  padding: 18px 22px;
}
.tl-panel h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
}
.tl-panel-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--rust);
  margin: 0 0 10px;
}
.tl-bullets {
  margin: 0;
  padding-left: 20px;
  max-width: 72ch;
}
.tl-bullets li {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.tl-bullets li::marker { color: var(--sage); }
.tl-bullets li:last-child { margin-bottom: 0; }

/* wide screens: stops fan out horizontally; panels share the row below */
@media (min-width: 820px) {
  .timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 24px;
  }
  /* the rail turns horizontal, running through the dots */
  .timeline::before {
    left: 8px;
    right: 8px;
    top: 39px;
    bottom: auto;
    width: auto;
    height: 2px;
  }
  .tl-progress {
    left: 8px;
    right: 8px;
    top: 39px;
    bottom: auto;
    width: auto;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
  }

  .tl-stop {
    grid-row: 1;
    width: auto;
    padding: 0 0 6px;
  }
  .tl-dot {
    position: static;
    display: block;
    margin: 8px 0 12px;
  }
  .tl-dates { margin-bottom: 0; }

  .tl-panel {
    grid-row: 2;
    grid-column: 1 / -1;
    margin: 26px 0 0;
    padding: 24px 28px;
  }
  /* on desktop the stop already shows org/role; don't repeat the heading */
  .tl-panel h3 { display: none; }
}

/* ==========================================================================
   CONTACT — dark umber close
   ========================================================================== */
.section-contact {
  background: var(--ink);
  color: var(--paper);
}
.section-contact .eyebrow { color: var(--sage); }
.section-contact .section-title { color: var(--paper); }

.contact-lede {
  color: var(--line);
  max-width: 50ch;
  margin: 0 0 40px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 48px;
}
.contact-channel { margin: 0; }
.contact-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 4px;
}
.contact-channel a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 30px);
  color: var(--paper);
  text-decoration: none;
  border-bottom: 2px solid rgba(220, 210, 190, 0.35);
  transition: border-color 150ms ease, color 150ms ease;
}
.contact-channel a:hover { color: #E8B296; border-color: #E8B296; }
.contact-channel a:focus-visible { outline-color: var(--paper); }

.contact-ai {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(220, 210, 190, 0.75);
  margin: 0;
}
.contact-ai a { color: #E8B296; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: rgba(220, 210, 190, 0.55);
  padding: 0 20px 28px;
}
.site-footer p {
  max-width: var(--content-width);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  border-top: 1px solid rgba(220, 210, 190, 0.16);
  padding-top: 20px;
}
