/* ---------- Design tokens ---------- */
:root {
  --maroon-deep: #4a1017;
  --maroon: #641b24;
  --maroon-light: #7a2733;
  --cream: #f2e8d4;
  --cream-dim: #e2d5b8;
  --paper: #ece3cf;
  --paper-dark: #d8cbaa;
  --ink: #241210;
  --gold: #cbb27a;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;
  --font-script: 'Caveat', cursive;
  --font-mono: 'Special Elite', monospace;

  /* Approximate fallback for the sticky navbar's height, used only until
     main.js measures the real value on load (see setNavHeight()) — keeps
     .hero--landing correctly sized even before that first script tick. */
  --nav-h: 58px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--maroon);
}

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

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid rgba(74, 16, 23, 0.18);
}

/* .nav-inner is centered with a max-width for the link group, which also
   pins .nav-brand inline with that centered container. Taking the brand out
   of this flow and anchoring it straight to .navbar (its nearest positioned
   ancestor) keeps it a fixed distance from the true viewport edge instead of
   the centered container's edge. */
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-brand {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--maroon-deep);
  text-decoration: none;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.nav-brand:hover,
.nav-brand:focus-visible {
  color: var(--maroon);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--maroon-deep);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

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

.nav-links a.active {
  color: var(--maroon);
  border-bottom: 1px solid var(--maroon);
}

.nav-brand:focus-visible,
.nav-links a:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--maroon-deep);
  outline-offset: 3px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--maroon-deep);
  display: block;
}

/* ---------- Sections ---------- */
.section {
  padding: 5rem 1.5rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.section-note {
  font-style: italic;
  opacity: 0.75;
  max-width: 640px;
  margin: 0 0 2.5rem;
}

.section-heading.center {
  text-align: center;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,0.04), transparent 60%),
    linear-gradient(160deg, var(--maroon-light), var(--maroon-deep));
}

/* Fills exactly the viewport space left below the sticky navbar, so the
   hero+navbar together occupy the full screen on load and no part of the
   next section is visible until the user scrolls — sized via calc()
   against the navbar's real measured height (see main.js), not a fixed
   spacer element. .scroll-cue below anchors to this, not .hero, so it
   only ever appears on the full-screen landing hero. */
.hero--landing {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 13vw, 10rem);
  margin: 0;
  color: var(--cream);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  line-height: 1;
}

.hero-subtitle {
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: clamp(0.85rem, 1.6vw, 1.3rem);
  margin: 1.5rem 0 0;
  color: var(--cream-dim);
}

/* Reserves real space below the subtitle — .hero-content is the box
   .hero's flex centering actually centers, so padding here (not margin,
   which wouldn't affect that centered box's own size) shifts the visible
   name/subtitle upward as a unit, guaranteeing clearance from
   .scroll-cue below regardless of viewport height. Sized so even at its
   minimum (short laptop heights) it clears .scroll-cue's own worst-case
   height (~50px, at bottom:36px max) with the required 80-100px to
   spare: 140px - 50px - 36px = 54px, comfortably inside that range once
   .scroll-cue's real (smaller) height is accounted for — verified
   directly against rendered geometry, not just this arithmetic. */
.hero-content {
  padding-bottom: clamp(96px, 14vh, 140px);
}

/* Understated invitation to scroll. Positioned independently of
   .hero-content (own layout container, own absolute placement against
   .hero--landing below) — never via margins/flex-spacing relative to the
   name block, so the two can never visually compete regardless of
   viewport height. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 3vh, 36px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--cream);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.25s ease;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  opacity: 1;
}

.scroll-cue:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: 4px;
}

.scroll-cue-label {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

/* The arrow is the ONLY thing that ever animates here, and only via
   translateY — .scroll-cue itself (the centering element, translateX(-50%))
   never gets an animated transform, so the two can never fight each
   other or visibly jump/reset. No opacity in the loop either, so there's
   nothing to read as flashing/flickering — just a slow, steady bob. */
.scroll-cue-arrow {
  animation: scroll-cue-bob 1.8s ease-in-out infinite;
}

@keyframes scroll-cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue-arrow { animation: none; }
}

/* ---------- Explore (landing page nav grid) ---------- */
.explore {
  background: var(--maroon-deep);
}

.explore-grid {
  max-width: 1100px;
  margin: 2.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.explore-card {
  position: relative;
  display: block;
  background: rgba(242, 232, 212, 0.06);
  border: 1px solid rgba(203, 178, 122, 0.35);
  border-radius: 6px;
  padding: 1.75rem 2.75rem 1.75rem 1.75rem;
  text-decoration: none;
  color: var(--cream);
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.explore-card:hover,
.explore-card:focus-visible {
  transform: translateY(-4px);
  background: rgba(242, 232, 212, 0.12);
  border-color: var(--gold);
}

.explore-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.explore-card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.6rem;
  color: var(--gold);
}

.explore-card p {
  margin: 0;
  color: var(--cream);
  opacity: 0.95;
  line-height: 1.5;
}

.explore-card-arrow {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translate(0, -50%);
  color: var(--gold);
  font-size: 1.15rem;
  transition: transform 0.3s ease;
}

.explore-card:hover .explore-card-arrow,
.explore-card:focus-visible .explore-card-arrow {
  transform: translate(4px, -50%);
}

@media (prefers-reduced-motion: reduce) {
  .explore-card,
  .explore-card-arrow {
    transition: none;
  }
}

/* ---------- About ---------- */
.about-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  align-items: start;
}

.polaroid {
  background: var(--cream);
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  transform: rotate(-2deg);
  margin: 0;
}

.polaroid-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #cfc2a2, #a99a72);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.polaroid figcaption {
  font-family: var(--font-display);
  color: var(--ink);
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--paper-dark);
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
}

.display-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0;
}

.about-name {
  font-size: 1.4rem;
  margin: 0.25rem 0 1.5rem;
}

.about-copy p {
  line-height: 1.7;
  font-size: 1.08rem;
  margin: 0 0 1.25rem;
}

.about-copy strong { color: var(--gold); }

.about-icons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--maroon-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* ---------- Skills ---------- */
.skills {
  background: var(--maroon-deep);
  padding: 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 90vh;
}

.skills-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.acai-bowl-placeholder {
  font-size: 6rem;
  margin-bottom: 1.5rem;
}

.skills-caption {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--gold);
  max-width: 320px;
  transform: rotate(-2deg);
}

.receipt {
  background: var(--paper);
  color: var(--ink);
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: var(--font-mono);
  background-image:
    repeating-linear-gradient(rgba(0,0,0,0.015) 0 2px, transparent 2px 4px);
}

.receipt-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0 0 0.5rem;
}

.receipt-subtitle {
  font-style: italic;
  opacity: 0.75;
  margin: 0 0 1rem;
}

.receipt-rule {
  border: none;
  border-top: 2px solid var(--ink);
  margin: 1rem 0;
}

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

.receipt-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.receipt-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1.5rem;
}

.barcode {
  flex: 1;
  height: 46px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 6px);
}

.receipt-stamp {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  white-space: nowrap;
}

.stamp-circle {
  border: 2px solid var(--maroon);
  color: var(--maroon);
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.1;
  transform: rotate(-8deg);
}

/* ---------- Content Creation ---------- */
.content-creation {
  background: var(--paper);
  color: var(--ink);
}

.content-creation .section-heading { color: var(--ink); }

.masonry {
  columns: 4 260px;
  column-gap: 1.25rem;
  max-width: 1300px;
  margin: 0 auto;
}

.masonry-item {
  break-inside: avoid;
  margin: 0 0 1.25rem;
  background: var(--cream);
  padding: 0.6rem 0.6rem 0.9rem;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.placeholder-photo {
  position: relative;
}

.masonry .placeholder-photo {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #d8cca9, #b7a878);
}

.masonry-item figcaption {
  padding-top: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--maroon-deep);
}

/* ---------- Projects / Marketing Campaigns ---------- */
.projects, .marketing-campaigns { background: var(--maroon); }

.card-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.placeholder-card {
  background: rgba(242, 232, 212, 0.06);
  border: 1px dashed rgba(242, 232, 212, 0.35);
  border-radius: 6px;
  padding: 1.75rem;
}

.placeholder-card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.6rem;
}

.placeholder-card p {
  opacity: 0.8;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.card-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
}

/* ---------- Contact ---------- */
.contact { background: var(--maroon-deep); text-align: center; }

.contact-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  font-family: var(--font-display);
  color: var(--cream);
  text-decoration: none;
  border: 1px solid var(--gold);
  padding: 0.75rem 2rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-link:hover {
  background: var(--gold);
  color: var(--maroon-deep);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cream);
  color: var(--maroon-deep);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}

.site-footer p {
  color: var(--maroon-deep);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .polaroid { max-width: 320px; margin: 0 auto; }
  .skills-grid { grid-template-columns: 1fr; }

  .nav-brand { left: 16px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid rgba(74, 16, 23, 0.18);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
}
