/* ============================================================
   site.css — the only stylesheet.
   Everything visual is controlled from the DESIGN TOKENS block
   just below. Change values there; nothing further down the
   file hard-codes a color, size, or timing.
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS — edit the whole look of the site here.
   ------------------------------------------------------------ */
:root {
  /* ---- colors ---- */
  --color-bg: #F4EFE6;              /* cream page background */
  --color-text: #201E1A;            /* main text. CHOICE: soft near-black instead of pure #000 — less harsh on cream. Alternative: #000. */
  --color-text-soft: #6E695F;       /* secondary text (captions, placeholder labels) */
  --color-line: #DAD3C4;            /* hairline borders (used sparingly) */
  --color-surface: #ECE6D8;         /* slightly darker cream for placeholder blocks and menu panel */
  --color-focus: #201E1A;           /* keyboard focus outline color */

  /* ---- typography ---- */
  /* Neutral system stacks. See the @font-face block at the bottom
     of this file for exactly where to drop in your own .woff2. */
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --text-body: 1.0625rem;                    /* base body size (17px) */
  --text-small: 0.875rem;                    /* captions, labels */
  --text-heading: clamp(1.5rem, 4vw, 2.25rem);   /* section headings */
  --text-display: clamp(2.5rem, 9vw, 5rem);      /* the big site-name type */
  --leading-body: 1.7;                       /* body line height */
  --leading-heading: 1.15;                   /* heading line height */
  --measure: 65ch;                           /* comfortable text column width */

  /* ---- spacing scale ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 7rem;      /* the big gap between home-page sections */
  --page-pad: clamp(1rem, 4vw, 2.5rem);   /* side padding on every page */

  /* ---- shape & motion ---- */
  --radius: 2px;                    /* CHOICE: near-square corners to stay out of the way. Alternatives: 0 for hard corners, 8px+ for soft. */
  --transition-fast: 150ms ease;    /* small hovers, menu */
  --reveal-duration: 600ms;         /* scroll-reveal fade time */
  --reveal-distance: 1.25rem;       /* how far sections travel upward as they appear */
  --reveal-stagger: 90ms;           /* delay between neighbors revealing together */

  /* ---- paper grain ---- */
  --grain-opacity: 0.04;            /* raise toward 0.08 to see it clearly, 0 to remove */
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  /* Everything lowercase. Delete this ONE line to restore normal casing site-wide. */
  text-transform: lowercase;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  min-height: 100vh;
}

/* Paper grain: a fixed, full-viewport overlay using a tiny inline SVG
   noise pattern (no image file). It sits on top of the page at very low
   opacity and ignores the mouse.
   CHOICE: grain overlays images too, like a print finish. Alternative:
   z-index: -1 puts it behind content so images stay clean. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: var(--leading-heading);
  font-weight: 600;   /* CHOICE: semi-bold headings. Alternatives: 400 for quiet, 700 for loud. */
}

/* ------------------------------------------------------------
   3. PAGE FRAME — header, footer, main column
   ------------------------------------------------------------ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-4) var(--page-pad);
  position: relative;   /* the dropdown menu positions itself against the header */
  z-index: 10;          /* keeps the open menu above page content */
}

.site-name {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 600;
  text-decoration: none;
}

main {
  padding: 0 var(--page-pad);
}

.site-footer {
  padding: var(--space-6) var(--page-pad) var(--space-5);
  font-size: var(--text-small);
  color: var(--color-text-soft);
}

/* ------------------------------------------------------------
   4. DROPDOWN MENU (top right, every page)
   Opens on click. JavaScript in js/site.js handles open/close,
   outside click, and the Escape key.
   ------------------------------------------------------------ */
.menu {
  position: relative;
}

.menu-toggle {
  font: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
}

/* Without JavaScript the button does nothing, so hide it and show
   the links as a plain row instead (see the .no-js rules below). */
.menu-panel {
  list-style: none;
  padding: 0;
}

/* When JavaScript is running, the html tag gets class "js" and the
   panel becomes a dropdown, hidden until opened. */
.js .menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 9rem;
  margin-top: var(--space-2);
  padding: var(--space-2) 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.js .menu.is-open .menu-panel {
  display: block;
}

.menu-panel a {
  display: block;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
}

.menu-panel a:hover {
  text-decoration: underline;
}

/* No-JS fallback: links sit in a simple horizontal row next to the button. */
html:not(.js) .menu-toggle {
  display: none;
}

html:not(.js) .menu-panel {
  display: flex;
  gap: var(--space-3);
}

html:not(.js) .menu-panel a {
  padding: 0;
}

/* ------------------------------------------------------------
   5. SCROLL-REVEAL SECTIONS
   Sections are fully visible by default (so the page reads fine
   with JavaScript off). When JS runs, it adds the "js" class to
   <html>; only then are sections faded down and revealed by the
   IntersectionObserver in js/site.js.
   ------------------------------------------------------------ */
.reveal {
  /* visible by default — nothing hidden without JS */
}

.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) ease-out,
    transform var(--reveal-duration) ease-out;
  transition-delay: var(--reveal-delay, 0ms);  /* set per-section by JS for the stagger */
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   6. HOME PAGE — intro block + alternating sections
   ------------------------------------------------------------ */
.intro {
  padding: var(--space-7) 0 var(--space-6);
}

.intro h1 {
  font-size: var(--text-display);
}

.intro p {
  margin-top: var(--space-3);
  color: var(--color-text-soft);
}

.flow-section {
  margin: var(--space-7) auto;
  max-width: 60rem;   /* CHOICE: sections cap at 60rem and center. Alternative: remove for true edge-to-edge. */
}

.flow-section h2 {
  font-size: var(--text-heading);
  margin-bottom: var(--space-3);
}

.flow-section p {
  max-width: var(--measure);
}

/* ------------------------------------------------------------
   7. PLACEHOLDER IMAGE FRAMES
   Flat neutral rectangles (SVG files in /img/) standing in for
   photography. The aspect-ratio keeps layout honest before the
   real images exist.
   ------------------------------------------------------------ */
.ph-frame {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.ph-frame img {
  width: 100%;
}

/* ------------------------------------------------------------
   8. PROJECTS PAGE — card grid
   ------------------------------------------------------------ */
.page-title {
  font-size: var(--text-heading);
  padding: var(--space-6) 0 var(--space-5);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;                /* one column on phones */
  gap: var(--space-5) var(--space-4);
  padding-bottom: var(--space-7);
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);   /* two columns on tablets */
  }
}

@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);   /* three on desktop */
  }
}

.card {
  text-decoration: none;
  display: block;
}

.card .ph-frame {
  aspect-ratio: 4 / 5;   /* CHOICE: 4:5 portrait crop on all cards. Alternative: 1 / 1 for square. */
}

.card-title {
  margin-top: var(--space-2);
  font-size: var(--text-body);
  font-weight: 600;
}

.card:hover .card-title {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   9. PROJECT DETAIL — swipeable gallery
   A horizontal scroll-snap strip. Swipes natively on touch;
   the arrow buttons and dots (desktop) are wired up in js/site.js
   and hidden when JavaScript is off.
   ------------------------------------------------------------ */
.gallery {
  position: relative;
  margin-top: var(--space-4);
  /* CHOICE: gallery capped at 40rem and centered so a 4:5 image doesn't
     tower on desktop. Alternative: remove these two lines for full width. */
  max-width: 40rem;
  margin-inline: auto;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: var(--space-3);
  scrollbar-width: none;            /* hide the scrollbar (Firefox) */
  -webkit-overflow-scrolling: touch;
}

.gallery-track::-webkit-scrollbar {
  display: none;                    /* hide the scrollbar (Chrome/Safari) */
}

.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.gallery-slide .ph-frame {
  aspect-ratio: 4 / 5;   /* CHOICE: matches the card crop so shots reuse. Alternatives: 1/1, 3/2. */
}

/* Arrow buttons — sit over the gallery edges. Hidden without JS. */
.gallery-arrow {
  display: none;
}

.js .gallery-arrow {
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  font: inherit;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 50%;
  cursor: pointer;
}

.gallery-arrow[data-dir="prev"] { left: var(--space-2); }
.gallery-arrow[data-dir="next"] { right: var(--space-2); }

/* Dot indicators — built by JS, so nothing shows without it. */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.gallery-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 1px solid var(--color-text-soft);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.gallery-dot.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
}

/* Project text block */
.project-title {
  font-size: var(--text-heading);
  margin-top: var(--space-5);
}

.project-story {
  max-width: var(--measure);
  margin: var(--space-4) 0 var(--space-6);
}

.project-story p + p {
  margin-top: var(--space-3);
}

/* ------------------------------------------------------------
   10. PLACES PAGE — map stub
   ------------------------------------------------------------ */
.map-stub {
  min-height: 55vh;
  display: grid;
  place-items: center;
  background: var(--color-surface);
  border-radius: var(--radius);
  color: var(--color-text-soft);
  margin-bottom: var(--space-7);
}

/* ------------------------------------------------------------
   11. REDUCED MOTION
   For visitors whose system asks for less animation, every
   transition above is switched off and reveal sections are
   simply shown.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------
   12. FONT DROP-IN POINT
   When you've picked a typeface, put the .woff2 file(s) in a
   /fonts/ folder, uncomment the block(s) below, and change
   --font-display / --font-body in the DESIGN TOKENS block at the
   top of this file to the family name you declare here.
   Nothing else needs to change anywhere.
   ------------------------------------------------------------ */
/*
@font-face {
  font-family: "YourDisplayFont";
  src: url("../fonts/your-display-font.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "YourBodyFont";
  src: url("../fonts/your-body-font.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
*/
