/* Grain: a portfolio website template for photographers.
   Rebrand by editing the tokens in :root. Nothing else needs to change. */

:root {
  --bg: #f7f7f4;
  --surface: #e9e9e5;
  --ink: #171717;
  --muted: #686864;
  --line: rgb(23 23 23 / 0.14);
  --accent: #0f766e;
  --accent-ink: #ffffff;

  --font-display: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Shape rule: every corner on the site uses this one value. */
  --radius: 0px;

  --wrap: 1400px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --gap: clamp(1rem, 2vw, 1.5rem);
  --section: clamp(4.5rem, 10vw, 9rem);
  --header: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layers: header 10, mobile menu 20. */
  color-scheme: light dark;
  accent-color: var(--accent);
}

/* Dark theme follows the visitor's system setting.
   To lock one theme, delete this block (light) or move its values into :root (dark). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101110;
    --surface: #1c1d1c;
    --ink: #ededea;
    --muted: #a2a39e;
    --line: rgb(237 237 234 / 0.16);
    --accent: #5eead4;
    --accent-ink: #101110;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-transform: none;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section > h2 { margin-bottom: clamp(2rem, 4.5vw, 3.5rem); }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 20;
  background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip:focus { top: 0.75rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.site-header__inner { height: var(--header); display: flex; align-items: center; justify-content: space-between; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.035em; text-transform: none; }
.nav { display: flex; align-items: center; gap: 2rem; }
.nav a:not(.btn), .link {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease);
}
.nav a:not(.btn):hover, .link:hover { background-size: 100% 1px; }
.menu-toggle {
  display: none; background: none; cursor: pointer;
  border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius); padding: 0.5rem 1rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.4rem; border-radius: var(--radius);
  font-weight: 500; white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--ink); color: var(--bg); }
.btn--ghost { box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn--small { padding: 0.55rem 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Media */
.media { overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.media img { width: 100%; height: 100%; object-fit: cover; }

/* Rows: a title on the left, a line of text on the right. */
.rows li {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: baseline;
  padding-block: clamp(1.25rem, 2.6vw, 2rem); border-top: 1px solid var(--line);
}
.rows h3 { grid-column: 1 / span 5; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.rows p { grid-column: 7 / span 6; color: var(--muted); }

/* Split: an image beside text. */
.split { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: center; }
.split__media { grid-column: 1 / span 5; aspect-ratio: 4 / 5; }
.split__copy { grid-column: 7 / span 6; }
.split__copy h2 { margin-bottom: 1.75rem; }
.split__copy p { max-width: 52ch; color: var(--muted); }
.split__copy p + p { margin-top: 1rem; }

/* Quote */
.quote blockquote { max-width: 26ch; font-family: var(--font-display); font-weight: 300; font-size: clamp(1.8rem, 3.8vw, 3rem); letter-spacing: -0.035em; line-height: 1.1; text-transform: none; }
.quote footer { margin-top: 2rem; font-family: var(--font-body); font-size: 1rem; font-weight: 400; letter-spacing: 0; line-height: 1.5; text-transform: none; }
.quote footer strong { display: block; font-weight: 600; }
.quote footer span { color: var(--muted); }

/* Contact */
.contact { border-top: 1px solid var(--line); }
.contact p { max-width: 44ch; color: var(--muted); }
.contact__mail {
  display: inline-block; margin-top: clamp(2rem, 4vw, 3rem);
  font-family: var(--font-display); font-weight: 300; font-size: clamp(1.8rem, 5.2vw, 4.5rem);
  letter-spacing: -0.035em; line-height: 1.1; text-transform: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 3px no-repeat;
  overflow-wrap: anywhere;
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: 0.95rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer small { flex-basis: 100%; color: var(--muted); font-size: 0.875rem; }

/* Reveal on scroll. Content stays visible when JavaScript is off. */
.js [data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn, .media img { transition: none; }
}

/* Small screens: every grid becomes one column. */
@media (max-width: 767px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; z-index: 20; top: var(--header); left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 1.1rem;
    padding: 1rem var(--gutter) 2rem; background: var(--bg); border-bottom: 1px solid var(--line);
    font-size: 1.25rem;
  }
  .nav.is-open { display: flex; }
  .rows li, .split { display: block; }
  .rows p { margin-top: 0.5rem; }
  .split__copy { margin-top: 2.5rem; }
}

/* Hero: one photograph, then a line of text. */
.cover { height: min(58dvh, 56vw); min-height: 16rem; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem 3rem; padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.intro h1 { font-size: clamp(2rem, 4.6vw, 3.9rem); max-width: 18ch; }
.intro p { max-width: 40ch; margin-top: 1rem; color: var(--muted); }

/* Gallery: columns, so photographs keep their own shape. */
.gallery { columns: 3; column-gap: var(--gap); }
.shot { display: block; margin-bottom: var(--gap); break-inside: avoid; cursor: zoom-in; overflow: hidden; background: var(--surface); }
.shot img { width: 100%; transition: transform 0.9s var(--ease); }
.shot:hover img { transform: scale(1.03); }

/* Series: a title, then a strip you can scroll sideways. */
.series { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: start; padding-block: clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--line); }
.series h3 { grid-column: 1 / span 3; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.series h3 small { display: block; margin-top: 0.5rem; font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.strip { grid-column: 4 / -1; display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
.strip .shot { flex: 0 0 min(15rem, 62vw); margin: 0; aspect-ratio: 4 / 5; scroll-snap-align: start; }
.strip .shot img { height: 100%; object-fit: cover; }

/* Lightbox */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox__bar, .lightbox__foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem var(--gutter); }
.lightbox__stage { min-height: 0; display: grid; place-items: center; padding-inline: var(--gutter); }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox button { cursor: pointer; border: 0; background: none; padding: 0.5rem 0; }
.lightbox button:hover { color: var(--accent); }
.lightbox__foot p { color: var(--muted); }
.lightbox__nav { display: flex; gap: 1.5rem; }

@media (max-width: 1023px) { .gallery { columns: 2; } }
@media (max-width: 767px) {
  .gallery { columns: 1; }
  .series { display: block; }
  .strip { margin-top: 1.25rem; }
}
