/* ==========================================================================
   Tommy Brophy — Photography
   Quiet, editorial layout that lets the photographs do the talking.
   Change the look in one place: the tokens below.
   ========================================================================== */

:root {
  --paper: #f5f3ee;
  --paper-2: #ebe8e1;
  --ink: #141414;
  --ink-2: #57544e;
  --ink-3: #8c887f;
  --rule: #d9d5cc;
  --accent: #1d3557;      /* a quiet Navy blue */
  --accent-ink: #ffffff;
  --overlay: rgba(8, 8, 8, 0.97);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f0f0e;
    --paper-2: #1a1a18;
    --ink: #ecebe6;
    --ink-2: #a9a69e;
    --ink-3: #75726b;
    --rule: #2a2926;
    --accent: #9db7d9;
    --accent-ink: #0f0f0e;
  }
}
:root[data-theme="dark"] {
  --paper: #0f0f0e;
  --paper-2: #1a1a18;
  --ink: #ecebe6;
  --ink-2: #a9a69e;
  --ink-3: #75726b;
  --rule: #2a2926;
  --accent: #9db7d9;
  --accent-ink: #0f0f0e;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font: 600 11px/1 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.display {
  font: 400 clamp(40px, 7vw, 96px)/0.98 var(--serif);
  letter-spacing: -0.01em;
  margin: 0;
}
.h2 { font: 400 clamp(32px, 4.5vw, 56px)/1.05 var(--serif); margin: 0; }
.h3 { font: 400 clamp(24px, 2.6vw, 32px)/1.15 var(--serif); margin: 0; }
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: var(--ink-2); max-width: 38em; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s;
  border-bottom: 1px solid transparent;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header.is-solid {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--rule);
}
.site-header.on-hero:not(.is-solid) { color: #fff; }
.brand { font: 400 26px/1 var(--serif); letter-spacing: .01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); }
.nav a {
  font: 600 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  position: relative; padding: 6px 0;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-tools { display: flex; align-items: center; gap: 14px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .menu-btn { display: grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); color: var(--ink);
    padding: 8px var(--gutter) 24px;
    border-bottom: 1px solid var(--rule);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s var(--ease);
  }
  .nav a { font-size: 13px; padding: 16px 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .nav a::after { display: none; }
  .menu-open .nav { transform: none; opacity: 1; pointer-events: auto; }
  .menu-open.site-header { background: var(--paper); color: var(--ink); }
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; height: 100svh; min-height: 560px;
  color: #fff; overflow: hidden; display: flex; align-items: flex-end;
}
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06); animation: settle 2.4s var(--ease) forwards;
}
@keyframes settle { to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 50%, rgba(0,0,0,.55) 100%);
}
.hero-copy { position: relative; z-index: 1; padding-bottom: clamp(40px, 9vh, 96px); }
.hero .eyebrow { color: rgba(255,255,255,.78); margin-bottom: 20px; }
.hero .display { white-space: pre-line; max-width: 14ch; }
.hero-meta {
  position: absolute; right: var(--gutter); bottom: clamp(40px, 9vh, 96px); z-index: 1;
  text-align: right; color: rgba(255,255,255,.75);
}
.scroll-cue {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 32px;
  font: 600 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.85);
}
.scroll-cue span { width: 40px; height: 1px; background: currentColor; }
@media (max-width: 700px) { .hero-meta { display: none; } }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(72px, 12vw, 160px); }
.section-tight { padding-block: clamp(48px, 7vw, 96px); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(32px, 5vw, 64px); flex-wrap: wrap; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
}
.link-arrow svg { width: 16px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

.intro-grid { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gutter); align-items: start; }
.intro-grid .lede { font: 400 clamp(26px, 3.2vw, 42px)/1.25 var(--serif); color: var(--ink); max-width: 24em; }
@media (max-width: 820px) { .intro-grid { grid-template-columns: 1fr; } }

/* Tiles (home sections / gallery index) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 24px); }
.tile { position: relative; display: block; overflow: hidden; background: var(--paper-2); }
.tile .frame { aspect-ratio: 4 / 5; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; }
.tile:hover img { transform: scale(1.04); }
.tile-cap { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 2px 4px; gap: 12px; background: var(--paper); }
.tile-cap .h3 { font-size: clamp(22px, 2.2vw, 28px); }
.tile-cap p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } .tile .frame { aspect-ratio: 4/3; } }

/* Film strip on home */
.strip {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 8px; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip a { flex: 0 0 auto; scroll-snap-align: start; height: clamp(220px, 34vw, 420px); }
.strip img { height: 100%; width: auto; object-fit: cover; }

/* Quote/band */
.band { background: var(--accent); color: var(--accent-ink); }
.band .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gutter); align-items: center; }
.band .h2 { max-width: 16ch; }
.band p { opacity: .82; }
@media (max-width: 820px) { .band .wrap { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 28px;
  font: 600 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  transition: background .25s, color .25s, transform .2s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: currentColor; }
.btn-ghost:hover span { color: var(--accent); }
.band .btn-ghost:hover { background: var(--accent-ink); color: var(--accent); }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- page head */
.page-head { padding-top: calc(var(--header-h) + clamp(48px, 9vw, 120px)); padding-bottom: clamp(32px, 5vw, 64px); }
.page-head .display { margin-top: 16px; }
.page-head .lede { margin-top: 20px; }

/* ---------------------------------------------------------------- masonry gallery */
.masonry { columns: 3 320px; column-gap: clamp(10px, 1.4vw, 20px); }
.masonry figure { margin: 0 0 clamp(10px, 1.4vw, 20px); break-inside: avoid; cursor: zoom-in; position: relative; overflow: hidden; background: var(--paper-2); }
.masonry img { width: 100%; height: auto; transition: transform 1s var(--ease), opacity .6s; opacity: 0; }
.masonry img.loaded { opacity: 1; }
.masonry figure:hover img { transform: scale(1.025); }
.masonry figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px;
  color: #fff; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,.55));
  opacity: 0; transform: translateY(6px); transition: .35s var(--ease);
}
.masonry figure:hover figcaption { opacity: 1; transform: none; }

.gallery-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.chip {
  height: 36px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 999px;
  font: 600 11px/34px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  transition: .2s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay); color: #eee;
  display: grid; grid-template-rows: auto 1fr auto; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-top, .lb-bottom { display: flex; justify-content: space-between; align-items: center; padding: 16px var(--gutter); gap: 16px; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); }
.lb-stage img { max-width: 100%; max-height: calc(100svh - 150px); object-fit: contain; transition: opacity .25s; user-select: none; -webkit-user-drag: none; }
.lb-nav { position: absolute; top: 0; bottom: 0; width: 22%; display: flex; align-items: center; padding: 0 16px; opacity: .55; transition: opacity .2s; }
.lb-nav:hover { opacity: 1; }
.lb-nav svg { width: 28px; height: 28px; }
.lb-prev { left: 0; } .lb-next { right: 0; justify-content: flex-end; }
.lb-title { font: 400 22px/1.2 var(--serif); }
.lb-meta { color: #aaa; }
.lb-bottom .btn { height: 40px; background: #fff; color: #111; border-color: #fff; }
.lb-bottom .btn:hover { background: transparent; color: #fff; }

/* ---------------------------------------------------------------- store */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(12px, 1.6vw, 24px); }
.product { display: block; }
.product .frame { aspect-ratio: 1; overflow: hidden; background: var(--paper-2); position: relative; }
.product img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.product:hover img { transform: scale(1.04); }
.product .tag {
  position: absolute; top: 12px; left: 12px; background: var(--paper); color: var(--ink);
  font: 600 10px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; padding: 6px 8px;
}
.product-info { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; }
.product-info h3 { margin: 0; font: 400 21px/1.2 var(--serif); }
.product-info .where { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.product-info .price { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.product.hidden { display: none; }

.pdp { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 5vw, 80px); padding-top: calc(var(--header-h) + 40px); align-items: start; }
.pdp-media { background: var(--paper-2); }
.pdp-media img { width: 100%; height: auto; }
.pdp-info { position: sticky; top: calc(var(--header-h) + 32px); }
.pdp-info .h2 { margin: 12px 0 8px; }
.pdp-price { font: 400 28px/1 var(--serif); margin: 20px 0 28px; }
.sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 24px; }
.size {
  border: 1px solid var(--rule); padding: 14px; text-align: left; transition: .2s;
  display: flex; justify-content: space-between; font-size: 14px;
}
.size:hover { border-color: var(--ink); }
.size[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.size .p { color: var(--ink-3); }
.fine { font-size: 13px; color: var(--ink-3); margin-top: 16px; }
.details { border-top: 1px solid var(--rule); margin-top: 32px; }
.details div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.details dt { color: var(--ink-3); }
.details dd { margin: 0; }
@media (max-width: 900px) { .pdp { grid-template-columns: 1fr; } .pdp-info { position: static; } }

/* ---------------------------------------------------------------- stories */
.story-list { display: grid; gap: clamp(48px, 8vw, 120px); }
.story-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gutter); align-items: center; }
.story-card:nth-child(even) { grid-template-columns: 1fr 1.3fr; }
.story-card:nth-child(even) .frame { order: 2; }
.story-card .frame { aspect-ratio: 3/2; overflow: hidden; background: var(--paper-2); }
.story-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.story-card:hover img { transform: scale(1.03); }
.story-card .h2 { margin: 14px 0 16px; }
@media (max-width: 820px) { .story-card, .story-card:nth-child(even) { grid-template-columns: 1fr; } .story-card:nth-child(even) .frame { order: 0; } }

.article-hero { height: 86svh; min-height: 480px; position: relative; color: #fff; display: flex; align-items: flex-end; }
.article-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.6)); }
.article-hero .wrap { position: relative; z-index: 1; padding-bottom: 56px; }
.article-hero .eyebrow { color: rgba(255,255,255,.8); }
.prose { max-width: 680px; margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter); }
.prose > p { font-size: 19px; line-height: 1.75; margin: 0 0 1.4em; }
.prose > .dek + p::first-letter { font: 400 4.2em/0.8 var(--serif); float: left; padding: 0.08em 0.1em 0 0; }
.prose .dek { font: 400 clamp(24px, 2.6vw, 30px)/1.35 var(--serif); color: var(--ink-2); margin-bottom: 2em; }
.prose figure { width: min(100vw, 1280px); margin: clamp(40px, 6vw, 72px) 0 clamp(40px, 6vw, 72px) calc(50% - min(50vw, 640px)); }
.prose figure img { min-height: 200px; background: var(--paper-2); }
.prose figure img { width: 100%; max-height: 92vh; object-fit: contain; }
.prose figcaption { max-width: 680px; margin: 12px auto 0; padding: 0 var(--gutter); font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------- about */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: start; padding-top: calc(var(--header-h) + 48px); }
.about-grid .frame { aspect-ratio: 4/5; overflow: hidden; }
.about-grid .frame img { width: 100%; height: 100%; object-fit: cover; }
.about-grid .h2 { margin: 16px 0 28px; }
.about-grid p { font-size: 17px; color: var(--ink-2); }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.services > div { background: var(--paper); padding: clamp(24px, 3vw, 40px); }
.services .num { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.services h3 { font: 400 28px/1.1 var(--serif); margin: 28px 0 8px; }
.services p { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 820px) { .about-grid, .services { grid-template-columns: 1fr; } }

/* Contact form */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--gutter); }
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font: 600 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.field input, .field select, .field textarea {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule); padding: 10px 0; border-radius: 0;
  transition: border-color .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.form-status { font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
@media (max-width: 820px) { .contact, .form .row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- logbook (map) */
.logbook { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gutter); align-items: start; }
#map .leaflet-tile-pane { filter: grayscale(1) contrast(.92) brightness(1.04); }
:root[data-theme="dark"] #map .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(.85) brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #map .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(.85) brightness(.9); } }
#map { height: min(70vh, 640px); background: var(--paper-2); position: sticky; top: calc(var(--header-h) + 24px); z-index: 0; }
@media (max-width: 900px) { #map { position: relative; top: 0; height: 52vh; } }
.entries { border-top: 1px solid var(--ink); }
.entry { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.entry:hover { background: var(--paper-2); }
.entry img { width: 56px; height: 56px; object-fit: cover; }
.entry h4 { margin: 0; font: 400 19px/1.2 var(--serif); }
.entry .mono { color: var(--ink-3); }
.entries-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 10px 0; }
.leaflet-container { font-family: var(--sans) !important; }
.pin { width: 12px; height: 12px; border-radius: 50%; background: #1d3557; border: 2px solid #fff; box-shadow: 0 0 0 1px #1d3557; }
@media (max-width: 900px) { .logbook { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--rule); padding: clamp(48px, 7vw, 88px) 0 32px; margin-top: clamp(48px, 8vw, 120px); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h5 { margin: 0 0 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.footer-grid a:hover { color: var(--ink); }
.footer-big { font: 400 clamp(36px, 5vw, 64px)/1 var(--serif); margin: 0 0 16px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; font-size: 12px; color: var(--ink-3); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .masonry img { opacity: 1; transform: none; }
}
