/* ==========================================================================
   Jessica Levaton — site styles
   Layout model: every section holds a grid (.fe). Each block (.b) carries its
   placement inline as  --m: row/col/row/col (mobile, 8 columns)
                        --d: row/col/row/col (desktop, 24 columns)
   so moving something is a one-line edit in the HTML.
   ========================================================================== */

:root {
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Lexend", "Helvetica Neue", Arial, sans-serif;
  --black: #000;
  --white: #fff;
  --light: #f5f5f5;
  --grey: #797979;

  --max-width: 1800px;
  --gutter: 6vw;              /* page side margin (mobile) */
  --grid-gap: 11px;
  --cols: 8;
  /* fluid type: sizes grow with the viewport, 1rem is the floor */
  --scale: min(0.012 * 100vh, 10.8px);
  --header-h: calc(100px + 12vw);
}

@media (min-width: 768px) {
  :root {
    --gutter: 3vw;
    --cols: 24;
    --scale: min(1.2vw, 21.6px);
    --header-h: calc(123px + 5vw);
  }
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (min-width: 768px) { html { font-size: 19px; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: .05em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
hr { border: 0; height: 1px; background: var(--black); margin: 0; width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 0;
}
h1 { font-size: calc(3.2 * var(--scale) + 1rem); line-height: 1.1336; }
h2 { font-size: calc(0.7 * var(--scale) + 1rem); line-height: 1.26; }
h3 { font-size: calc(0.5 * var(--scale) + 1rem); line-height: 1.274; }
h4 { font-size: calc(0.3 * var(--scale) + 1rem); line-height: 1.3; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--black); color: var(--white); padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }

/* ---------------------------------------------------------------- header */
/* The header floats over the top of the first section (so section backgrounds
   run behind it); the first section makes room with --header-h. */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6vw;
}
main > :first-child { padding-top: calc(var(--header-h) + var(--pt-m, 0px)); }
@media (min-width: 768px) { main > :first-child { padding-top: calc(var(--header-h) + var(--pt-d, 0px)); } }
.logo img { width: 100px; height: 100px; }
.site-nav { display: none; }
.site-nav a, .mobile-menu a { text-decoration: none; }

@media (min-width: 768px) {
  .site-header { padding: 2.5vw 3vw; }
  .logo img { width: 123px; height: 123px; }
  .site-nav { display: flex; gap: 2.5vw; }
  .site-nav a { padding: .1em 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s ease; }
  .site-nav a:hover, .site-nav a[aria-current] { background-size: 100% 1px; }
  .burger { display: none !important; }
}

.burger {
  display: flex; flex-direction: column; justify-content: center; gap: 9px;
  width: 44px; height: 44px; padding: 5px; background: none; border: 0; cursor: pointer; position: relative; z-index: 30;
}
.burger span { display: block; height: 1px; width: 100%; background: var(--black); transition: transform .25s ease; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 20; background: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.mobile-menu a { font-family: var(--font-heading); font-size: 2.4rem; letter-spacing: -.02em; }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { position: fixed; z-index: 30; }

/* -------------------------------------------------------------- sections */
.section {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: var(--pt-m, 0); padding-bottom: var(--pb-m, 0);
}
.section.h-small  { min-height: 33vh; }
.section.h-medium { min-height: 66vh; }
.section.h-large  { min-height: 100vh; }
.section-gallery, .section-portfolio { display: block; min-height: 0; }
.section-bg { position: absolute; inset: 0; z-index: 0; }
.section-bg img { width: 100%; height: 100%; object-fit: cover; }
svg.section-bg { width: 100%; height: 100%; pointer-events: none; }

@media (min-width: 768px) {
  .section { padding-top: var(--pt-d, 0); padding-bottom: var(--pb-d, 0); }
}

/* ------------------------------------------------------------- the grid */
.fe {
  --side: calc(var(--gutter) - var(--col-gap, var(--grid-gap)));
  --cell: calc((var(--max-width) - var(--col-gap, var(--grid-gap)) * (var(--cols) - 1)) / var(--cols));
  --row: 24px;
  position: relative; z-index: 1;
  display: grid;
  width: 100%;
  gap: var(--row-gap, var(--grid-gap)) var(--col-gap, var(--grid-gap));
  grid-template-columns: minmax(var(--side), 1fr) repeat(var(--cols), minmax(0, var(--cell))) minmax(var(--side), 1fr);
  grid-template-rows: repeat(var(--rows-m), minmax(var(--row), auto));
  overflow-x: clip;
}

.b {
  grid-area: var(--m);
  z-index: var(--zm, 1);
  position: relative;
  min-width: 0;
  display: flex; flex-direction: column;
  justify-content: var(--vm, flex-start);
}

@media (min-width: 768px) {
  .fe {
    --container: min(var(--max-width), 100vw - var(--gutter) * 2);
    --row: calc(var(--container) * var(--row-scale, 0.0215));
    grid-template-rows: repeat(var(--rows-d), minmax(var(--row), auto));
  }
  .b { grid-area: var(--d); z-index: var(--zd, 1); justify-content: var(--vd, flex-start); }
}

/* ---------------------------------------------------------------- blocks */
/* images fill whatever grid area they were given */
.b-image .media, .b-image .media-link { position: relative; flex: 1 1 auto; min-height: 0; display: block; }
.b-image .media-link .media { position: absolute; inset: 0; }
.b-image img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: var(--fit-m, cover); object-position: var(--pos-m, 50% 50%);
}
.b-image .mask-circle img { clip-path: circle(closest-side); }
.b-image .media-link { transition: opacity .2s ease; }
.b-image .media-link:hover { opacity: .8; }
@media (min-width: 768px) {
  .b-image img { object-fit: var(--fit-d, cover); object-position: var(--pos-d, 50% 50%); }
}

.b-video video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--light); }

.b-shape .shape { flex: 1 1 auto; }

.b-rule { justify-content: center; }

/* rich text */
.text > :first-child { margin-top: 0; }
.text > :last-child { margin-bottom: 0; }
.text p { margin: 1rem 0; white-space: pre-wrap; }
.text p.gap { min-height: 1.4em; }
.text h1, .text h2, .text h3, .text h4 { white-space: pre-wrap; }
.text h2, .text h3, .text h4 { margin: 0 0 2rem; }
.text strong { font-weight: 600; }
.text a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.text a:hover { opacity: .7; }
.text-large { font-size: calc(0.3 * var(--scale) + 1rem); letter-spacing: .05rem; }
.text-small { font-size: calc(-0.1 * var(--scale) + 1rem); }
.text pre { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }

.b-boxed { background: var(--light); }
.text.boxed { padding: 6%; }

/* "scaled" text always fits the width of its block, like a fitted headline */
.b:has(> .scaled) { container-type: inline-size; }
.text.scaled, .text.scaled > * { font-size: calc(var(--fs-m) * 1cqw); line-height: 1.2; margin: 0; white-space: nowrap; }
@media (min-width: 768px) { .text.scaled, .text.scaled > * { font-size: calc(var(--fs-d) * 1cqw); } }
.scaled p { letter-spacing: .05em; }
.wordmark { font-family: var(--font-heading); font-weight: 500; letter-spacing: -.02em; }
.text.scaled > .wordmark { letter-spacing: -.02em; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.2rem; padding: 0 1.3rem;
  border: 1px solid var(--black); background: transparent; color: var(--black);
  font: inherit; letter-spacing: normal; text-decoration: none; text-align: center; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.btn:hover { background: var(--black); color: var(--white); }
.btn-fill { flex: 1 1 auto; width: 100%; }

/* ---------------------------------------------------- classic (row) layout */
.classic { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 1; }
.classic .row { display: flex; flex-direction: column; }
.classic .cb { padding: 17px 0; }
@media (min-width: 768px) {
  .classic .row { flex-direction: row; margin: 0 -17px; }
  .classic .col { flex: 0 0 calc(var(--span) / 12 * 100%); min-width: 0; }
  .classic .col > .cb { padding: 17px; }
  .classic .col > .row { margin: 0; }
}

/* --------------------------------------------------------------- masonry */
.masonry { column-count: 2; column-gap: var(--gutter-px, 0); }
.masonry figure { margin: 0 0 var(--gutter, 0); break-inside: avoid; aspect-ratio: var(--ar); overflow: hidden; }
.masonry img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 576px) { .masonry { column-count: 3; } }
@media (min-width: 768px) { .masonry { column-count: 4; } }
@media (min-width: 992px) { .masonry { column-count: var(--cols, 5); } }
/* site.js upgrades this to true left-to-right masonry */
.masonry.is-js { column-count: initial; display: flex; align-items: flex-start; gap: var(--gutter, 0); }
.masonry.is-js .masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gutter, 0); }
.masonry.is-js figure { margin: 0; }

/* ------------------------------------------------------- portfolio cards */
.portfolio {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; gap: 30px 20px;
  padding: 10vw var(--gutter);
  max-width: calc(var(--max-width) + var(--gutter) * 2); margin: 0 auto;
}
@media (min-width: 768px) { .portfolio { grid-template-columns: repeat(3, 1fr); } }
.card { text-decoration: none; text-align: center; display: block; }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--light); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease; }
.card:hover .card-img img { opacity: .7; }
.card h3 { font-size: calc(0.3 * var(--scale) + 1rem); line-height: 1.3; margin: 20px 0 .5em; }

/* ------------------------------------------------------------ prev / next */
.pager { display: flex; justify-content: space-between; gap: 1rem; padding: 3vw 6vw; }
.pager a { display: flex; align-items: center; gap: 1rem; text-decoration: none; font-size: calc(0.5 * var(--scale) + 1rem); line-height: 1; letter-spacing: .02em; }
.pager .next { text-align: right; margin-left: auto; }
.pager svg { width: 18px; height: 32px; flex: none; stroke-width: 1; transition: transform .2s ease; }
.pager .prev:hover svg { transform: translateX(-4px); }
.pager .next:hover svg { transform: translateX(4px); }
@media (min-width: 768px) { .pager { padding: 3vw; } }

/* ------------------------------------------------------------------ form */
.b-form { border-radius: 16px; }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; width: 100%; }
.contact-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.contact-form .name-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.contact-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.contact-form .req { opacity: .7; font-size: .85em; margin-left: .3em; display: inline; }
.contact-form label:not(.hp) { display: block; }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; padding: 5px 0; margin-top: .2rem;
  font: inherit; font-size: 1rem; letter-spacing: .05em; color: inherit;
  background: transparent; border: 0; border-bottom: 1px solid var(--black); border-radius: 0;
}
.contact-form textarea { resize: vertical; min-height: 5.6rem; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-width: 2px; }
.contact-form .btn { align-self: flex-start; min-height: 0; padding: 1rem 1.3rem; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-status { margin: 0; min-height: 1.4em; font-size: .9rem; }
.form-status.error { color: #a40000; }

/* ---------------------------------------------------------------- 404 */
.notfound { min-height: 50vh; text-align: center; align-items: center; padding: 10vw var(--gutter); gap: 1rem; }

/* ------------------------------------------------------ fade-in on scroll */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transition: opacity .6s ease; }
  .js .reveal.in { opacity: 1; }
}
