/* Integrated Formula LLC
   Palette drawn from the boat: hull blue-black, pewter hardware, wake white, teak trim. */

:root {
  --ink:        #070E16;
  --hull:       #0E1B29;
  --hull-lift:  #16283A;
  --pewter:     #8A9AA8;
  --pewter-dim: #5D6E7C;
  --wake:       #EEF3F6;
  --teak:       #B4793D;

  --rule: color-mix(in srgb, var(--pewter) 22%, transparent);

  --display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --body: "Archivo", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --measure: 34rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--wake);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, textarea, select):focus-visible {
  outline: 2px solid var(--teak);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--wake);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- shared */

.shell {
  width: min(100%, 78rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pewter);
  margin: 0;
}

.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0.75rem 0 0;
}

.section {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.section--ruled {
  border-top: 1px solid var(--rule);
}

.prose {
  max-width: var(--measure);
  color: color-mix(in srgb, var(--wake) 82%, var(--ink));
  font-size: clamp(1rem, 1.6vw, 1.125rem);
}
.prose p { margin: 0 0 1.25rem; }
.prose p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: min(100svh, 56rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: drift 24s var(--ease) forwards;
}

@keyframes drift { to { transform: scale(1); } }

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Two scrims: vertical for the masthead and plate, horizontal so the
     headline stays legible where it crosses the bright white topsides. */
  background:
    linear-gradient(to right,
      color-mix(in srgb, var(--ink) 82%, transparent) 0%,
      color-mix(in srgb, var(--ink) 45%, transparent) 42%,
      transparent 75%),
    linear-gradient(to bottom,
      color-mix(in srgb, var(--ink) 72%, transparent) 0%,
      color-mix(in srgb, var(--ink) 22%, transparent) 38%,
      color-mix(in srgb, var(--ink) 86%, transparent) 88%,
      var(--ink) 100%);
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: clamp(1.25rem, 3vw, 2.25rem);
}

.masthead__mark {
  font-family: var(--display);
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: 500;
}

.masthead__est {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pewter);
}

.hero__body {
  align-self: end;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hero__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.25rem, 13vw, 10.5rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0;
  text-wrap: balance;
}

.hero__tagline {
  max-width: 30rem;
  margin: 1.5rem 0 2rem;
  color: color-mix(in srgb, var(--wake) 80%, var(--ink));
  font-size: clamp(1rem, 1.8vw, 1.1875rem);
}

/* ------------------------------------------------- builder's plate strip */

.plate {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  backdrop-filter: blur(8px);
}

.plate__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.plate__cell {
  padding: clamp(0.875rem, 2vw, 1.375rem) 0;
  border-left: 1px solid var(--rule);
  padding-left: clamp(0.875rem, 2vw, 1.5rem);
}
.plate__cell:first-child { border-left: 0; padding-left: 0; }

.plate__label {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pewter-dim);
  margin-bottom: 0.3rem;
}

.plate__value {
  font-size: clamp(1rem, 2vw, 1.3125rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.plate__value .unit {
  color: var(--teak);
  font-size: 0.8em;
  margin-left: 0.1em;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid transparent;
  border-radius: 1px;
  padding: 1rem 2rem;
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn--primary {
  background: var(--wake);
  color: var(--ink);
}
.btn--primary:hover { background: #fff; transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: var(--wake);
  border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--pewter); background: color-mix(in srgb, var(--wake) 6%, transparent); }

.btn[disabled] { opacity: 0.55; cursor: progress; transform: none; }

/* --------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1.2vw, 1rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.shot {
  position: relative;
  grid-column: span 2;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: var(--hull);
  cursor: zoom-in;
}

/* An editorial rhythm rather than a uniform grid: two wide anchors per cycle. */
.shot:nth-child(7n + 1) { grid-column: span 4; aspect-ratio: 16 / 9; }
.shot:nth-child(7n + 5) { grid-column: span 3; aspect-ratio: 3 / 2; }
.shot:nth-child(7n + 6) { grid-column: span 3; aspect-ratio: 3 / 2; }

/* <picture> is a layout no-op; the <img> inside carries the styling. */
.shot picture,
.hero__media picture,
.lightbox picture { display: contents; }

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.6s var(--ease);
}
.shot:hover img { transform: scale(1.04); }

.shot--pending { opacity: 0; }
.shot--in { opacity: 1; }

/* ----------------------------------------------------------------- specs */

.specs {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

.spec {
  display: grid;
  grid-template-columns: minmax(7rem, 14rem) 1fr;
  gap: 1rem 2rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.spec dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pewter);
}

.spec dd {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.1875rem);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- inquiry */

.inquiry {
  background: var(--hull);
  border-top: 1px solid var(--rule);
}

.inquiry__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
}

@media (min-width: 60rem) {
  .inquiry__grid { grid-template-columns: 0.85fr 1fr; }
}

.field {
  display: block;
  margin-bottom: 1.5rem;
}

.field__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pewter);
  margin-bottom: 0.5rem;
}

.field__label .optional {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--pewter-dim);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  color: var(--wake);
  font-family: var(--body);
  font-size: 1.0625rem;
  padding: 0.65rem 0;
  transition: border-color 0.25s var(--ease);
}

.field input:hover,
.field textarea:hover { border-bottom-color: var(--pewter-dim); }

.field input:focus,
.field textarea:focus {
  outline: 0;
  border-bottom-color: var(--teak);
}

.field textarea { resize: vertical; min-height: 6.5rem; }

.field input::placeholder,
.field textarea::placeholder { color: var(--pewter-dim); }

.field__error {
  display: block;
  min-height: 1.25rem;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: #E8A87C;
}

.field--invalid input,
.field--invalid textarea { border-bottom-color: #E8A87C; }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.5rem;
}
@media (min-width: 34rem) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* Honeypot — off-screen but not display:none, so bots still fill it. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: 1.25rem;
  min-height: 1.5rem;
  font-size: 0.9375rem;
}
.form-status--error { color: #E8A87C; }
.form-status--ok { color: var(--wake); }

.sent {
  border: 1px solid var(--rule);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}
.sent h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}
.sent p { margin: 0; color: color-mix(in srgb, var(--wake) 78%, var(--hull)); }

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3rem;
  font-size: 0.8125rem;
  color: var(--pewter-dim);
}

.footer__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer a { color: var(--pewter); text-decoration: none; }
.footer a:hover { color: var(--wake); }

/* -------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  padding: clamp(1rem, 4vw, 3rem);
  border: 0;
}

/* A <dialog> is display:none until open; only lay it out once it actually is. */
.lightbox[open] {
  display: grid;
  place-items: center;
}
.lightbox::backdrop { background: color-mix(in srgb, var(--ink) 94%, transparent); }

/* Fixed-width wrapper so layout doesn't depend on the image's intrinsic size. */
.lightbox__frame {
  width: min(100%, 76rem);
  display: flex;
  flex-direction: column;
}

.lightbox img {
  max-width: 100%;
  max-height: 82svh;
  object-fit: contain;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pewter);
  font-variant-numeric: tabular-nums;
}

.lightbox__nav { display: flex; gap: 0.5rem; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--wake);
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 1px;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--pewter); background: color-mix(in srgb, var(--wake) 8%, transparent); }

/* ------------------------------------------------------------- reveal/motion */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__media img { transform: none; }
  .shot--pending { opacity: 1; }
}

/* ------------------------------------------------------------------ small */

@media (max-width: 40rem) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .shot,
  .shot:nth-child(7n + 1),
  .shot:nth-child(7n + 5),
  .shot:nth-child(7n + 6) { grid-column: span 2; aspect-ratio: 4 / 3; }
  .spec { grid-template-columns: 1fr; gap: 0.25rem; }

  /* A phone-shaped crop of a wide profile shot loses the boat, so on small
     screens the hero stops being an overlay: the photo runs as a landscape
     band and the type sits on solid ground beneath it. */
  .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hero__media {
    position: relative;
    inset: auto;
    /* The overlay layout parks this behind the hero; in flow it must paint. */
    z-index: 0;
    order: 1;
    aspect-ratio: 16 / 10;
    width: 100%;
  }

  .hero__media img { transform: none; animation: none; }

  /* Only the bottom fade survives — it blends the photo into the page. */
  .hero__media::after {
    background: linear-gradient(to bottom,
      transparent 55%,
      color-mix(in srgb, var(--ink) 55%, transparent) 82%,
      var(--ink) 100%);
  }

  .masthead { order: 0; }

  .hero__body {
    order: 2;
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
  }

  .plate { order: 3; backdrop-filter: none; background: transparent; }

  /* Two fixed columns, so the cell that starts each row loses its divider. */
  .plate__row { grid-template-columns: 1fr 1fr; }
  .plate__cell:nth-child(odd) { border-left: 0; padding-left: 0; }
  .plate__cell:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
