/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Colors and sizes (change the look here) ---------- */
:root {
  --cream: #fbf5e9;        /* light cream, used with the orange zig zag */
  --sand: #f4ecdf;        /* page background */
  --sand-deep: #e9dcc6;   /* subtle panels */
  --espresso: #2b1d14;    /* main text */
  --orange: #b04a16;      /* accent: links, button */
  --orange-dark: #8f3a0e; /* button hover */
  --pine: #3f5b45;        /* small secondary touches */
  --orange-light: #e8844a; /* orange for use on dark backgrounds */
  --nav-bg: rgba(43, 29, 20, 0.94);
  --nav-bg-scrolled: rgba(43, 29, 20, 0.55); /* desktop, once you start scrolling */
  --nav-height: 72px;

  --font-heading: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
/* Desktop text scales with the window: 16px at a 1440px-wide window, smaller when narrower, larger on big screens.
   Everything sized in rem follows this. Phones keep the normal 16px. */
@media (min-width: 761px) {
  html { font-size: clamp(13px, calc(0.5vw + 8.8px), 22px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
body {
  margin: 0;
  background: var(--sand);
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
}
a { color: var(--orange); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--espresso); color: var(--sand);
  padding: 10px 16px; border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-height);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.25s ease;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
}
.site-nav.is-scrolled { background: var(--nav-bg-scrolled); }
.site-nav :focus-visible { outline-color: var(--sand); }
.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--orange-light);
  text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav-logo-mark { height: 30px; width: 30px; display: block; }
@media (min-width: 761px) {
  .nav-logo-mark { height: 34px; width: 34px; }
}
.nav-logo:hover { color: var(--sand); }
.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: clamp(20px, 4.5vw, 72px);
}
.nav-links a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sand);
  text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
  /* Extra space on the left balances the letter spacing after the last letter, so the words are truly centered */
  --nav-pad: 4px;
  /* Bottom padding lifts the capital letters to the true middle of the bar (the font leaves extra room below them) */
  padding: 0 var(--nav-pad) 0.08em calc(var(--nav-pad) + 0.06em);
  position: relative;
}
.nav-links a:hover { color: var(--orange-light); }
.nav-links a[aria-current="true"] { color: var(--orange-light); }
/* Underline that runs exactly from the first letter to the last letter */
.nav-links a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: calc(var(--nav-pad) + 0.06em);
  right: calc(var(--nav-pad) + 0.06em);
  top: calc(50% + 0.5em);
  height: 3px;
  background: var(--orange-light);
}
.nav-links a.nav-contact {
  background: var(--orange);
  color: #fff;
  padding: 0 20px 0.08em;
  border-radius: 999px;
  text-decoration: none;
}
.nav-links a.nav-contact:hover { background: var(--orange-dark); color: #fff; }

.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 48px; height: 48px;
  align-items: center; justify-content: center; flex-direction: column; gap: 6px;
}
.nav-toggle span {
  display: block; width: 26px; height: 3px;
  background: var(--sand); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Desktop: Work / About / Resume sit in the middle of the bar, logo far left, Contact far right */
@media (min-width: 761px) {
  .site-nav { justify-content: center; }
  .nav-logo, .nav-links li:last-child {
    position: absolute; top: 50%; transform: translateY(-50%);
  }
  .nav-logo { left: clamp(16px, 3vw, 40px); }
  .nav-links li:last-child { right: clamp(16px, 3vw, 40px); }
  /* About sits exactly in the middle of the screen; Work and Resume sit equal distances either side of it */
  .nav-links {
    display: grid; grid-template-columns: 1fr auto 1fr;
    width: min(100%, 720px);
    pointer-events: none;
  }
  .nav-links li { pointer-events: auto; }
  .nav-links li:nth-child(1) { justify-self: end; }
  .nav-links li:nth-child(3) { justify-self: start; }
}

@media (max-width: 760px) {
  .site-nav, .site-nav.is-scrolled {
    background: var(--espresso);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--espresso);
    padding: 8px 16px 20px;
    box-shadow: 0 12px 24px rgba(43, 29, 20, 0.3);
    display: none;
  }
  .nav-links { padding-bottom: 0; }
  /* zig zag strip at the bottom of the open menu */
  .nav-links::after { content: ""; display: block; flex: none; margin: 20px -16px 0; }
  .nav-links.is-open { display: flex; }
  .nav-links a { font-size: 1.5rem; min-height: 56px; border-bottom: 0; --nav-pad: 8px; }
  .nav-links a[aria-current="true"] { border-left: 4px solid var(--orange-light); padding-left: 12px; }
  .nav-links a[aria-current="true"]::after { display: none; }
  .nav-links a.nav-contact { justify-content: center; margin-top: 12px; }
}

/* ---------- Landing page: project panels ---------- */
.panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  height: 100svh;
  min-height: 640px;
}
/* Zig zag strip right under the nav bar */
.panels > .zigzag { grid-column: 1 / -1; margin-top: var(--nav-height); }
/* Heading band above the panels: says whose work this is */
.work-intro {
  grid-column: 1 / -1;
  background: var(--sand);
  padding: 14px clamp(16px, 3vw, 36px) 16px;
  text-align: center;
}
.work-intro h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  line-height: 1;
  color: var(--espresso);
  margin: 0 0 4px;
}
.work-intro .accent { color: var(--orange); }
.work-intro p { margin: 0; font-size: 1.0625rem; color: var(--espresso); }
/* Desktop: the heading band is hidden from view (still there for screen readers) so the photos start right under the zig zag */
@media (min-width: 761px) {
  .panels { grid-template-rows: auto minmax(0, 1fr); }
  .work-intro {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
/* The one arrow used everywhere on the site (project names, back and next links) */
.arrow {
  width: 0.62em; height: 0.62em; vertical-align: 0.02em;
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.arrow-right { margin-left: 0.12em; }
.arrow-left { margin-right: 0.12em; transform: scaleX(-1); }
.back-link .arrow, .next-link .arrow { width: 0.8em; height: 0.8em; }
.back-link .arrow-left { margin-right: 0.3em; }
.next-link .arrow-right { margin-left: 0.3em; }
.nowrap { white-space: nowrap; }
.panel-arrow { display: none; }
.panel {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--espresso);
  color: #fff;
  text-decoration: none;
}
.panel picture, .panel-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel-img { object-fit: cover; object-position: var(--focus, 50% 50%); }

.panel-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--pine), var(--espresso));
  font-family: var(--font-heading);
  font-size: 1.5rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Shading across the bottom: light by default, deeper on hover/focus */
.panel::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(to top, rgba(43, 29, 20, 0.88), rgba(43, 29, 20, 0));
  opacity: 0.55;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.panel:hover::after, .panel:focus-visible::after { opacity: 1; }
/* The photo sits on top of a normal outline, so the focus ring is drawn as its own layer */
.panel:focus-visible { outline: none; }
.panel:focus-visible::before {
  content: "";
  position: absolute; inset: 8px; z-index: 2;
  border: 4px solid #fff;
  box-shadow: 0 0 0 2px rgba(43, 29, 20, 0.7), inset 0 0 0 2px rgba(43, 29, 20, 0.7);
  border-radius: 2px;
  pointer-events: none;
}

.panel-label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: clamp(16px, 2.5vw, 36px);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.panel-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.panel-tag {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--orange);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .panels { display: block; height: auto; min-height: 0; }
  .work-intro { padding-top: 28px; padding-bottom: 30px; }
  .work-intro h1 { font-size: clamp(2.4rem, 12.7vw, 4.25rem); margin-bottom: 10px; }
  .work-intro p { font-size: clamp(0.88rem, 4.69vw, 1.57rem); }
  .panel-img { object-position: var(--focus-mobile, var(--focus, 50% 50%)); }
  .panel { height: 78vw; max-height: 520px; }
  .panel-name { font-size: 2.25rem; }
  .panel-arrow { display: inline-block; }
}

/* ---------- About section ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "text photo";
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding: 56px clamp(16px, 6vw, 96px) 72px;
}
.about-text { grid-area: text; max-width: 36rem; }
.about-text h2 { font-size: clamp(3.5rem, 9vw, 7rem); color: var(--espresso); }
.about-text p { font-size: 1.1875rem; max-width: 34rem; }
.about-photo { grid-area: photo; justify-self: center; width: 100%; max-width: 480px; }
.about-img, .about-photo picture { width: 100%; }
.about-img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.about-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 5;
  background: var(--sand-deep);
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 1.5rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--pine);
}

@media (max-width: 760px) {
  .about {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "text";
    align-items: start;
    min-height: 0;
    gap: 28px;
    padding-top: 32px;
  }
  .about-photo { max-width: 420px; }
}

/* ---------- Project pages ---------- */
.tag {
  display: inline-block; margin: 0 0 20px;
  font-family: var(--font-heading); font-weight: 600; font-size: 1rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--orange); color: #fff;
  padding: 2px 12px; border-radius: 999px;
}
.project {
  display: grid;
  grid-template-columns: minmax(300px, 4fr) 6fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  padding: calc(var(--nav-height) + 32px) clamp(16px, 4vw, 64px) 64px;
  max-width: 1600px; margin: 0 auto;
}
/* Desktop: the screen is split in two. Text on the left, gallery on the right,
   and each side scrolls on its own, like the scroll bar in the sketch. */
@media (min-width: 901px) {
  .project {
    grid-template-columns: 9fr 11fr; /* text a bit narrower, photos a bit wider */
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    height: 100vh; height: 100svh;
    max-width: none; margin: 0;
    padding: var(--nav-height) 0 0;
    overflow: hidden;
  }
  .project-info, .project-gallery {
    min-height: 0; height: 100%; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(43, 29, 20, 0.28) transparent;
  }
  /* Padding sits inside each scrolling half, so the scroll bars never touch the content */
  .project-info {
    padding: 32px clamp(24px, 4vw, 64px) 48px;
  }
  .project-gallery {
    align-content: start; grid-auto-rows: max-content;
    padding: 32px clamp(16px, 2vw, 32px) 48px;
  }
}
.back-link, .next-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.125rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: var(--orange);
}
.back-link:hover, .next-link:hover { text-decoration: underline; }
.project-logo { height: 72px; margin: 12px 0 20px; display: flex; justify-content: center; }
.project-logo img { height: 72px; width: auto; max-width: 220px; object-fit: contain; }
.project-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 72px; margin-inline: auto;
  border: 2px dashed var(--pine); border-radius: 12px;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.75rem;
  color: var(--pine);
}
.project-title { font-size: clamp(2.5rem, 4.5vw, 4rem); margin-bottom: 16px; text-align: center; }
.project-info .tag { display: table; margin: 0 auto 20px; }
.project-description p { margin: 0 0 1em; max-width: 34rem; }
.project-description ul { padding-left: 1.2em; max-width: 34rem; }
.project-description li { margin-bottom: 0.75em; }
.project-meta { margin: 28px 0; max-width: 34rem; }
.project-meta div { display: flex; gap: 16px; padding: 10px 0; border-top: 1px solid var(--sand-deep); }
.project-meta dt {
  flex: 0 0 7rem;
  font-family: var(--font-heading); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--pine);
}
.project-meta dd { margin: 0; }
.next-link { margin-top: 12px; }
.next-link-end { display: none; }

/* Two columns: most photos span both, "half" photos sit side by side so related shots stay together */
.project-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-gallery figure { grid-column: 1 / -1; align-self: start; margin: 0; background: var(--sand-deep); border-radius: 4px; overflow: hidden; }
.project-gallery figure.is-half { grid-column: auto; }
.gallery-heading {
  grid-column: 1 / -1; margin: 20px 0 -4px;
  font-size: 1.5rem; letter-spacing: 0.1em; color: var(--orange-dark);
}
.gallery-heading:first-child { margin-top: 0; }
.project-gallery .gallery-placeholder { grid-column: 1 / -1; }
.project-gallery picture { display: block; }
.project-gallery img { display: block; width: 100%; height: auto; }
/* Crop a photo to a square so it lines up with a square photo beside it (add "square: true" in the project file) */
.project-gallery figure.is-square img { aspect-ratio: 1 / 1; object-fit: cover; }
.project-gallery figcaption {
  padding: 8px 12px; font-size: 0.875rem; color: var(--espresso);
  background: var(--sand);
}
.gallery-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 5; border-radius: 4px;
  background: linear-gradient(160deg, var(--pine), var(--espresso));
  font-family: var(--font-heading); font-size: 1.5rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; gap: 32px; padding-top: calc(var(--nav-height) + 16px); }
  .next-link-side { display: none; }
  .next-link-end { display: inline-flex; }
}

/* ---------- Page sections (preview styles, refined in later stages) ---------- */
.page-section { min-height: 100vh; padding: calc(var(--nav-height) + 40px) clamp(16px, 5vw, 64px) 64px; }
.page-section h1, .page-section h2 { font-size: clamp(2.5rem, 7vw, 5rem); }
.stage-note { color: var(--pine); font-weight: 600; }

/* ---------- Resume section ---------- */
.button {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 22px; border-radius: 999px;
  background: var(--orange); color: #fff; text-decoration: none;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.125rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.button:hover { background: var(--orange-dark); color: #fff; }

.resume {
  background: var(--sand-deep);
  padding: calc(var(--nav-height) + 32px) clamp(16px, 6vw, 96px) 80px;
}
.resume-inner { max-width: 54rem; margin: 0 auto; }
.resume-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 24px; margin-bottom: 32px;
}
.resume-head h2 { font-size: clamp(3.5rem, 9vw, 7rem); color: var(--espresso); margin: 0; }
.resume-body h3 {
  font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--orange-dark);
  border-bottom: 2px solid var(--espresso);
  padding-bottom: 6px; margin: 40px 0 16px;
}
.resume-body h4 {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 24px;
  font-family: var(--font-body, inherit); font-weight: 700; font-size: 1.0625rem;
  text-transform: none; letter-spacing: 0; color: var(--espresso);
  margin: 24px 0 6px;
}
.resume-date { font-weight: 500; white-space: nowrap; }
.resume-body p { margin: 0 0 8px; }
.resume-body ul { margin: 0 0 8px; padding-left: 1.25rem; }
.resume-body li { margin-bottom: 6px; }

/* ---------- Contact section ---------- */
.contact {
  background: var(--espresso); color: var(--sand);
  padding: 72px clamp(16px, 6vw, 96px) 88px;
}
.contact-inner { max-width: 54rem; margin: 0 auto; }
.contact h2 { font-size: clamp(3.5rem, 9vw, 7rem); color: var(--sand); margin: 0 0 12px; }
.contact p { font-size: 1.1875rem; margin: 0 0 32px; }
.contact-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 0 22px; border: 2px solid var(--sand); border-radius: 999px;
  color: var(--sand); text-decoration: none; font-weight: 600;
}
.contact-links a:hover, .contact-links a:focus-visible { background: var(--sand); color: var(--espresso); }
.contact-links svg {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.contact-handle { font-weight: 400; opacity: 0.85; }

@media (max-width: 760px) {
  .resume { padding-top: 48px; }
  .resume-date { white-space: normal; }
  .contact { padding-top: 56px; }
  .contact-links { flex-direction: column; }
  .contact-links a { width: 100%; }
}

/* ---------- Zig zag divider (burnt orange on light cream) ---------- */
.zigzag, .nav-links::after {
  --zz: 28px;
  height: var(--zz);
  background-color: var(--cream);
  background-image:
    linear-gradient(135deg, var(--orange) 25%, transparent 25%),
    linear-gradient(225deg, var(--orange) 25%, transparent 25%),
    linear-gradient(315deg, var(--orange) 25%, transparent 25%),
    linear-gradient(45deg, var(--orange) 25%, transparent 25%);
  background-size: var(--zz) var(--zz);
  background-position: calc(var(--zz) / -2) 0, calc(var(--zz) / -2) 0, 0 0, 0 0;
}
@media (max-width: 760px) { .zigzag { --zz: 22px; } }

