/* ==========================================================================
   Ocean Dive Club — coming soon landing
   Values come from the Figma previews: Mobile 393×852, Tablet 834×1194,
   Desktop 1440×1024.
   ========================================================================== */

/* Fonts
   ========================================================================== */

@font-face {
  font-family: "Switzer";
  src: url("assets/switzer-font-family/WEB/fonts/Switzer-Bold.woff2") format("woff2"),
    url("assets/switzer-font-family/WEB/fonts/Switzer-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* The Figma design was set in Söhne Mono; borrowing its vertical metrics places the
   Geist Mono label on the same baseline as the previews. Box sizes are unaffected. */
@font-face {
  font-family: "Geist Mono";
  src: url("assets/Geist_Mono/GeistMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  ascent-override: 103.7%;
  descent-override: 28.9%;
}

@font-face {
  font-family: "Market Condensed";
  src: url("assets/Market%20Condensed%20Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* In the popup references the copy's apostrophe is proportional, while Geist Mono's
   sits in a full monospace cell; Switzer Light supplies just that one glyph. */
@font-face {
  font-family: "Switzer Apostrophe";
  src: url("assets/switzer-font-family/WEB/fonts/Switzer-Light.woff2") format("woff2"),
    url("assets/switzer-font-family/WEB/fonts/Switzer-Light.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2019;
}

:root {
  --color-cream: #fdfdf3;
  --color-navy: #062847;
  --color-blue: #0f5faa;
  /* Average tone of the hero videos; only visible until the first frame paints. */
  --color-ocean: #225b76;

  --font-title: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --font-button: "Geist Mono", ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --font-display: "Market Condensed", "Arial Narrow", sans-serif;

  --viewport-height: 100vh;

  /* Mobile (default) */
  --logo-width: 233px;
  --panel-radius: 12px;
  --panel-padding-block: 24px;
  --panel-padding-inline: 20px;
  --panel-gap: 12px;
  --title-size: 20px;
  --title-line-height: 26px;
  --title-text-width: 205px;
  --button-size: 16px;
  --button-line-height: 21px;
  --button-padding-block: 14px;
  --button-width: 353px;

  /* Notify modal (Pop-up_*.png). The privacy note (gap + two lines) fills what was
     bottom padding in the references, so the form keeps its position;
     --modal-padding-bottom is the space left below the note. */
  --modal-width: 353px;
  --modal-height: 604px;
  --modal-padding-top: 48px;
  --modal-padding-left: 20px;
  --modal-padding-right: 20px;
  --modal-padding-bottom: 10px;
  --modal-note-gap: 12px;
  --modal-note-size: 11px;
  --modal-note-line-height: 16px;
  --modal-title-size: 36px;
  --modal-title-line-height: 49px;
  --modal-body-size: 16px;
  --modal-body-line-height: 22px;
  --modal-body-gap: 40px;
  --modal-body-overhang: 0px;
  --modal-form-title-size: 24px;
  --modal-form-title-line-height: 33px;
  --modal-form-title-gap: 20px;
  --modal-mark-size: 164px;
  --modal-mark-top: -31px;
  --modal-mark-right: -43.5px;

  --logo-height: calc(var(--logo-width) * 193.122 / 233);
  --button-height: calc(var(--button-line-height) + 2 * var(--button-padding-block));
  --panel-height: calc(
    2 * var(--panel-padding-block) + var(--title-line-height) + var(--panel-gap) +
      var(--button-height)
  );
}

@supports (height: 100dvh) {
  :root {
    --viewport-height: 100dvh;
  }
}

/* Tablet */
@media (min-width: 768px) {
  :root {
    --logo-width: 264px;
    --title-size: 22px;
    --title-line-height: 29px;
    --title-text-width: 228px;
    --button-size: 18px;
    --button-line-height: 24px;

    --modal-width: 532px;
    --modal-height: 674px;
    --modal-padding-top: 60px;
    --modal-padding-left: 48px;
    --modal-padding-right: 49px;
    --modal-padding-bottom: 22px;
    --modal-note-gap: 14px;
    --modal-title-size: 40px;
    --modal-title-line-height: 55px;
    --modal-body-size: 18px;
    --modal-body-line-height: 25px;
    --modal-body-gap: 49px;
    --modal-body-overhang: 20px;
    --modal-form-title-size: 28px;
    --modal-form-title-line-height: 38px;
    --modal-mark-size: 203.5px;
    --modal-mark-top: -41px;
    --modal-mark-right: -61px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  :root {
    --logo-width: 288px;
    --panel-radius: 24px;
    --title-size: 24px;
    --title-line-height: 32px;
    --title-text-width: 246px;
    --button-size: 20px;
    --button-line-height: 27px;

    --modal-width: 768px;
    --modal-padding-left: 60px;
    --modal-padding-right: 61px;
    --modal-padding-bottom: 15px;
    --modal-note-size: 12px;
    --modal-note-line-height: 18px;
    --modal-title-size: 48px;
    --modal-title-line-height: 65px;
    --modal-body-size: 20px;
    --modal-body-line-height: 28px;
    --modal-body-gap: 40px;
    --modal-body-overhang: 0px;
    --modal-form-title-size: 32px;
    --modal-form-title-line-height: 43px;
    --modal-form-title-gap: 24px;
    --modal-mark-size: 231.5px;
    --modal-mark-top: -46.5px;
    --modal-mark-right: -69.5px;
  }
}

/* Base
   ========================================================================== */

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

html {
  background-color: var(--color-ocean);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  /* Closest match to Figma's text rendering on macOS. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout
   ========================================================================== */

/* Exactly one screen: the panel keeps its height and the hero takes the rest. */
.landing {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: var(--viewport-height);
  overflow: hidden;
}

/* Hero
   ========================================================================== */

.hero {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  /* The previews centre the logo on the full screen, i.e. half a panel below the
     hero's centre. Padding the hero's top by the panel height reproduces that,
     and the clamp keeps the logo clear of the panel on short screens. */
  padding-top: clamp(
    0px,
    var(--viewport-height) - var(--panel-height) - var(--logo-height),
    var(--panel-height)
  );
}

/* As in the Figma frames, the video covers the whole screen and the panel sits
   on top of it — this sets the crop and fills the panel's rounded corners. */
.hero__video {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}

/* Hide the play glyph iOS shows when autoplay is blocked (e.g. Low Power Mode). */
.hero__video::-webkit-media-controls,
.hero__video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.hero__title {
  margin: 0;
}

/* The PNG is the bare artwork: 201 units wide inside the Figma logo frame
   (--logo-width × --logo-height), which the hero still reserves on short screens. */
.hero__logo {
  display: block;
  width: calc(var(--logo-width) * 201 / 233);
  height: auto;
}

/* Notification panel
   ========================================================================== */

.notification {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--panel-gap);
  padding: var(--panel-padding-block) var(--panel-padding-inline);
  border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  background-color: var(--color-cream);
}

.notification__title {
  display: flex;
  align-items: center;
  margin: 0;
  color: var(--color-navy);
  font: 700 var(--title-size) / var(--title-line-height) var(--font-title);
}

.notification__icon {
  flex: none;
  width: 1em;
  height: 1em;
}

/* In Figma the text sits in a fixed-width frame with centred text right after
   the icon, so the words land slightly right of centre. min-width keeps that
   while still letting wider fallback fonts fit. */
.notification__text {
  min-width: var(--title-text-width);
  text-align: center;
}

.notification__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(var(--button-width), 100%);
  padding: var(--button-padding-block) 24px;
  border: 0;
  border-radius: 999px;
  background-color: var(--color-blue);
  color: var(--color-cream);
  font: 600 var(--button-size) / var(--button-line-height) var(--font-button);
  cursor: pointer;
}

.notification__button:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

/* Notify modal
   ========================================================================== */

/* The dialog fills the screen and acts as the click-outside area; ::backdrop dims
   the page behind it. */
.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 12px 20px;
  border: 0;
  background: transparent;
  overflow: auto;
}

.modal[open] {
  display: flex;
}

.modal::backdrop {
  background-color: rgb(0 0 0 / 48%);
}

.modal__panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(var(--modal-width), 100%);
  /* On short screens the free space above the form gives way before the modal scrolls. */
  min-height: min(var(--modal-height), 100%);
  margin: auto;
  /* On tablet/desktop the right padding is 1px larger: Figma rounds the centred
     353px controls down to whole pixels. */
  padding: var(--modal-padding-top) var(--modal-padding-right) var(--modal-padding-bottom)
    var(--modal-padding-left);
  overflow: hidden;
  border-radius: 16px;
  background-color: var(--color-cream);
  color: var(--color-navy);
}

/* Pale wave symbol: the brand blue at 28% over the cream, cropped by the panel. */
.modal__mark {
  position: absolute;
  top: var(--modal-mark-top);
  right: var(--modal-mark-right);
  z-index: -1;
  width: var(--modal-mark-size);
  height: var(--modal-mark-size);
  color: var(--color-blue);
  opacity: 0.28;
  pointer-events: none;
}

.modal__title {
  margin: 0;
  font: 500 var(--modal-title-size) / var(--modal-title-line-height) var(--font-display);
}

/* On tablet the copy's text box runs into the right padding (--modal-body-overhang),
   which gives the reference's exact line breaks. */
.modal__body {
  margin: var(--modal-body-gap) calc(-1 * var(--modal-body-overhang)) 40px 0;
  font: 400 var(--modal-body-size) / var(--modal-body-line-height) "Switzer Apostrophe",
    var(--font-mono);
  letter-spacing: 0.02em;
}

/* Pinned to the bottom of the panel, as in the references. */
.modal__form {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
}

.modal__form-title {
  margin: 0 0 var(--modal-form-title-gap);
  font: 500 var(--modal-form-title-size) / var(--modal-form-title-line-height) var(--font-display);
}

/* Fields are the button's height plus their 1px border. */
.modal__field {
  width: min(var(--button-width), 100%);
  height: calc(var(--button-height) + 2px);
  padding: 0 24px;
  border: 1px solid var(--color-blue);
  border-radius: 24px;
  background-color: transparent;
  color: var(--color-navy);
  font: 600 var(--button-size) var(--font-mono);
  -webkit-appearance: none;
  appearance: none;
}

.modal__field ~ .modal__field {
  margin-top: 12px;
}

/* The placeholders are the only visible labels: 84% is the lowest opacity that keeps
   them at WCAG AA contrast (4.55:1) on the cream. */
.modal__field::placeholder {
  color: var(--color-blue);
  opacity: 0.84;
}

.modal__submit {
  width: min(var(--button-width), 100%);
  margin-top: 16px;
  padding: var(--button-padding-block) 24px;
  border: 0;
  border-radius: 24px;
  background-color: var(--color-blue);
  color: var(--color-cream);
  font: 700 var(--button-size) / var(--button-line-height) var(--font-mono);
  cursor: pointer;
}

.modal__field:focus-visible,
.modal__submit:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

/* Privacy note under the button. While an error is shown it takes the note's place,
   8px below the button, exactly where it sat before the note existed. */
.modal__note {
  position: relative;
  width: min(var(--button-width), 100%);
  margin-top: var(--modal-note-gap);
}

.modal__privacy {
  margin: 0;
  opacity: 0.7;
  font: 400 var(--modal-note-size) / var(--modal-note-line-height) "Switzer Apostrophe",
    var(--font-mono);
  text-align: center;
  text-wrap: balance;
}

.modal__status:not(:empty) + .modal__privacy {
  visibility: hidden;
}

/* Submission messages. Neither changes the modal's size: the error line overlays the
   privacy note, and the confirmation covers the form, which keeps its footprint
   while hidden. They receive focus only programmatically. */
.modal__status {
  position: absolute;
  top: calc(8px - var(--modal-note-gap));
  left: 0;
  right: 0;
  margin: 0;
  font: 400 14px / 18px var(--font-mono);
  text-align: center;
  text-wrap: balance;
}

.modal__success {
  display: none;
  position: absolute;
  inset: 0 0 auto;
  text-align: center;
}

.modal__form[data-state="sent"] > :not(.modal__success) {
  visibility: hidden;
}

.modal__form[data-state="sent"] .modal__success {
  display: block;
}

.modal__success-text {
  margin: 0;
  font: 400 var(--modal-body-size) / var(--modal-body-line-height) "Switzer Apostrophe",
    var(--font-mono);
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.modal__status:focus,
.modal__success:focus {
  outline: none;
}

/* Utilities
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
