/* ==========================================================================
   Devyn Underwater — design system
   cream #F5F6F8 · teal #018DAC · sand #D4D4D4 · ink #1C2567
   Type: Avenir (native Apple) → Mulish fallback. Motion respects reduced-motion.
   ========================================================================== */

:root {
  --cream: #F5F6F8;
  --teal: #018DAC;
  --teal-deep: #016E86;
  --sand: #D4D4D4;
  --ink: #1C2567;
  --navy-deep: #131A4A;
  --navy-deeper: #0E1334;
  --teal-bright: #33BEDC;
  --ink-90: rgba(28, 37, 103, .9);
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 76px;
  --font: Avenir, "Avenir Next", Mulish, "Segoe UI", Helvetica, Arial, sans-serif;
  --heavy: 800;
  --shadow: 0 14px 40px rgba(12, 18, 60, .20);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 10px); }
body {
  margin: 0; font-family: var(--font); font-weight: 300;
  font-size: 1.0625rem; line-height: 1.7;
  color: var(--ink); background: var(--cream);
  overflow-x: clip;
}
img, video, svg, iframe { max-width: 100%; }
img, video { height: auto; display: block; }
h1, h2, h3 { font-weight: var(--heavy); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .55em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1.15em; }
a { color: var(--teal-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.skip-link { position: absolute; left: -9999px; background: var(--ink); color: var(--cream); padding: .7rem 1.2rem; z-index: 300; }
.skip-link:focus { left: 0; top: 0; }
.grid > *, .split > * { min-width: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .65rem 1.9rem;
  font-family: inherit; font-weight: var(--heavy); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .18s ease, color .18s ease, transform .15s ease;
  border-radius: 0;
}
.btn:active { transform: scale(.98); }
.btn-light { background: transparent; color: var(--cream); border: 1.5px solid var(--cream); }
.btn-light:hover { background: var(--cream); color: var(--ink); }
.btn-dark { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-dark:hover { background: var(--ink); color: var(--cream); }
.btn-solid { background: var(--ink); color: var(--cream); border: 1.5px solid var(--ink); }
.btn-solid:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-teal { background: var(--teal); color: var(--cream); border: 1.5px solid var(--teal); }
.btn-teal:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--cream); }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .25s ease, box-shadow .25s ease;
  background: linear-gradient(180deg, rgba(10,14,40,.55), transparent);
}
.site-header.scrolled { background: var(--ink); box-shadow: 0 2px 18px rgba(0,0,0,.25); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.logo img { height: 46px; width: auto; }
.site-nav ul { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; align-items: center; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .9rem;
  color: var(--cream); text-decoration: none; font-weight: 500; font-size: .98rem; letter-spacing: .04em;
}
.site-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 6px; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.site-nav .nav-cta { border: 1.5px solid var(--cream); margin-left: .6rem; padding: .45rem 1.2rem; }
.site-nav .nav-cta:hover { background: var(--cream); color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; width: 48px; height: 48px; background: none; border: 0; cursor: pointer; }
.nav-toggle .ham { position: relative; display: block; width: 26px; height: 2px; margin-inline: auto; background: var(--cream); transition: background .15s; }
.nav-toggle .ham::before, .nav-toggle .ham::after { content: ""; position: absolute; left: 0; width: 26px; height: 2px; background: var(--cream); transition: transform .2s, top .2s; }
.nav-toggle .ham::before { top: -8px; }
.nav-toggle .ham::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .ham { background: transparent; }
.nav-toggle[aria-expanded="true"] .ham::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .ham::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--ink); display: none; border-top: 1px solid rgba(245,246,248,.15); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: .8rem var(--gutter) 1.4rem; }
  .site-nav a { min-height: 52px; font-size: 1.08rem; }
  .site-nav .nav-cta { margin: .8rem 0 0; justify-content: center; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; color: var(--cream); overflow: clip; background: var(--ink); }
.hero-media { position: absolute; inset: 0; }
.hero-media .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease-in-out; }
.hero-media .slide.active { opacity: 1; }
.hero-media .slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); }
/* three slow drift variants — restart each time a slide becomes active */
.js .hero-media .slide.active:nth-child(3n+1) img { animation: kbIn 5.5s ease-out forwards; }
.js .hero-media .slide.active:nth-child(3n+2) img { animation: kbOut 5.5s ease-out forwards; }
.js .hero-media .slide.active:nth-child(3n) img { animation: kbPan 5.5s ease-out forwards; }
@keyframes kbIn  { from { transform: scale(1.03); }                     to { transform: scale(1.1) translate(-1%, -1.2%); } }
@keyframes kbOut { from { transform: scale(1.11) translate(1%, .8%); }  to { transform: scale(1.03); } }
@keyframes kbPan { from { transform: scale(1.08) translate(1.4%, 0); }  to { transform: scale(1.08) translate(-1.4%, .6%); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10,14,40,.72) 15%, rgba(10,14,40,.25) 60%, rgba(10,14,40,.45)); }
.hero .container { position: relative; z-index: 2; }
.hero h1 { color: var(--cream); max-width: 15ch; }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 44ch; color: rgba(245,246,248,.9); }
.hero .btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.8rem; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2; color: var(--cream); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; opacity: .8; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

.page-hero { background: var(--teal); color: var(--cream); padding: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem)) 0 clamp(2.2rem, 5vw, 3.5rem); }
.page-hero h1 { color: var(--cream); }
.page-hero .lede { color: rgba(245,246,248,.92); max-width: 60ch; }
.page-hero.dark { background: var(--ink); }
.page-hero.light { background: var(--sand); color: var(--ink); }
.page-hero.light h1 { color: var(--ink); }
.page-hero.light .lede { color: rgba(28, 37, 103, .85); }
.page-hero.light .kicker { color: var(--teal-deep); opacity: 1; }

/* ---------- sections ---------- */
.section { padding-block: clamp(3.2rem, 8vw, 6rem); }
.section-teal { background: var(--teal); color: var(--cream); }
.section-teal h2, .section-teal h3 { color: var(--cream); }
.section-teal p { color: rgba(245,246,248,.92); }
.section-sand { background: var(--sand); color: var(--ink); }
.section-sand h2, .section-sand h3 { color: var(--ink); }
.section-sand p { color: var(--ink); }
.section-sand a { color: var(--teal-deep); }
.section-ink { background: var(--ink); color: var(--cream); }
.section-ink h2, .section-ink h3 { color: var(--cream); }
.section-ink p { color: rgba(245,246,248,.85); }
.kicker { font-size: .8rem; font-weight: var(--heavy); letter-spacing: .24em; text-transform: uppercase; opacity: .75; margin-bottom: 1rem; }
.rule { width: 44px; height: 2px; background: currentColor; opacity: .5; margin-bottom: 1.2rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.8rem, 5vw, 4rem); align-items: center; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split .media img { width: 100%; object-fit: cover; box-shadow: var(--shadow); }

/* ---------- scroll reveal (hidden state only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; } .reveal-d2 { transition-delay: .16s; } .reveal-d3 { transition-delay: .24s; }

/* ---------- film strip (horizontal scroll-snap) ---------- */
.strip-wrap { position: relative; }
.strip { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip a { flex: 0 0 auto; scroll-snap-align: center; position: relative; display: block; }
.strip img { height: clamp(240px, 38vw, 380px); width: auto; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.strip a:hover img { transform: scale(1.03); filter: brightness(1.08); }
.strip figcaption { position: absolute; left: .9rem; bottom: .8rem; color: var(--cream); font-size: .85rem; letter-spacing: .06em; text-shadow: 0 1px 8px rgba(0,0,0,.7); opacity: 0; transition: opacity .3s; }
.strip a:hover figcaption { opacity: 1; }
.strip-nav { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .4rem; }
.strip-nav button { width: 48px; height: 48px; border: 1.5px solid currentColor; background: none; color: inherit; font-size: 1.2rem; cursor: pointer; }
.strip-nav button:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.section-ink .strip-nav button:hover, .section-teal .strip-nav button:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ---------- gallery (justified-ish responsive grid + filters) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.filter-bar button {
  min-height: 46px; padding: .5rem 1.3rem; font-family: inherit; font-size: .9rem; font-weight: var(--heavy);
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  background: none; border: 1.5px solid var(--ink); color: var(--ink); transition: background .18s, color .18s, border-color .18s;
}
.filter-bar button:hover, .filter-bar button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .gallery { grid-template-columns: 1fr; } }
.tile { position: relative; display: block; overflow: hidden; background: var(--ink); border: 0; padding: 0; cursor: zoom-in; width: 100%; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease, opacity .4s; }
.tile:hover img { transform: scale(1.06); }
.tile .tile-cap {
  position: absolute; inset: auto 0 0 0; padding: 2rem .9rem .7rem;
  background: linear-gradient(transparent, rgba(10,14,40,.75));
  color: var(--cream); font-size: .9rem; letter-spacing: .05em; text-align: left;
  opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s;
}
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; transform: none; }
.tile.hidden { display: none; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; background: rgba(8, 11, 32, .96); }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(92vw, 1500px); max-height: 82vh; width: auto; height: auto; box-shadow: 0 20px 80px rgba(0,0,0,.6); }
.lb-cap { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--cream); letter-spacing: .08em; font-size: .95rem; text-align: center; max-width: 80vw; }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; background: none; border: 1.5px solid rgba(245,246,248,.6); color: var(--cream); font-size: 1.4rem; cursor: pointer; transition: background .15s; }
.lb-btn:hover { background: rgba(245,246,248,.15); }
.lb-prev { left: max(12px, 2vw); }
.lb-next { right: max(12px, 2vw); }
.lb-close { position: absolute; top: 18px; right: 18px; width: 52px; height: 52px; background: none; border: 0; color: var(--cream); font-size: 1.8rem; cursor: pointer; }

/* ---------- shop ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 1.6rem); }
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .product-grid { grid-template-columns: 1fr; } }
a.product-card { display: block; text-decoration: none; color: inherit; }
.product-card .ph { overflow: hidden; background: var(--ink); }
.product-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s ease; }
.product-card:hover img { transform: scale(1.05); }
.product-card h3 { margin: .8rem 0 .1rem; font-size: 1.05rem; }
.product-card p { font-size: .88rem; opacity: .75; margin: 0; }
.media-pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.4rem; }
.media-pills li { border: 1px solid var(--ink); padding: .35rem .9rem; font-size: .85rem; letter-spacing: .05em; }
.buy-box { background: #fff; border: 1px solid var(--sand); padding: clamp(1.2rem, 3vw, 1.8rem); box-shadow: var(--shadow); }
.trust-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; font-size: .85rem; opacity: .8; margin-top: 1rem; }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
label { font-size: .85rem; font-weight: var(--heavy); letter-spacing: .06em; display: block; margin-bottom: .3rem; }
input, textarea {
  width: 100%; min-height: 50px; padding: .7rem .9rem; font-family: inherit; font-size: 1rem;
  background: rgba(255,255,255,.92); color: var(--ink); border: 1px solid var(--sand); border-radius: 0;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--teal); }
.section-teal input, .section-teal textarea { background: rgba(245,246,248,.95); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(245,246,248,.85); }
.site-footer a { color: rgba(245,246,248,.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: clamp(1.6rem, 4vw, 3rem); padding-block: clamp(2.6rem, 6vw, 4rem); align-items: start; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid .footer-logo { grid-column: 1 / -1; order: -1; } }
.site-footer h4 { color: var(--cream); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.footer-logo img { max-width: 300px; margin-left: auto; }
@media (max-width: 800px) { .footer-logo img { margin-left: 0; max-width: 240px; } }
.footer-legal { border-top: 1px solid rgba(245,246,248,.16); padding-block: 1.1rem; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between; font-size: .85rem; color: rgba(245,246,248,.6); }

.notice { background: rgba(1,141,172,.12); border: 1px solid var(--teal); padding: 1rem 1.2rem; font-size: .95rem; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2rem; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media .slide img, .scroll-cue { animation: none !important; }
  .hero-media .slide { transition: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tile img, .strip img, .product-card img { transition: none !important; }
}

/* floating edit button — only injected for logged-in editors */
#edit-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  background: var(--ink); color: var(--cream); text-decoration: none;
  font-weight: var(--heavy); font-size: .9rem; letter-spacing: .05em;
  padding: .8rem 1.3rem; box-shadow: 0 8px 30px rgba(0,0,0,.35);
  border: 1.5px solid rgba(245,246,248,.4);
}
#edit-fab:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
