/* ==========================================================
   PenHarbour — Coming Soon
   Mobile-first. Breakpoints: 521px, 768px, 1200px, 1800px
   ========================================================== */

:root {
  --navy: #0B2545;
  --deep: #06152B;
  --gold: #E9B44C;
  --gold-light: #FFE29A;
  --white: #fff;
  --ok: #9be3b0;
  --err: #ffb4a8;
  --font-head: Fraunces, Georgia, "Times New Roman", serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--deep);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.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;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Hero layout ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;            /* fallback */
  min-height: 100svh;           /* avoids mobile browser bar cut-off */
  overflow: hidden;
}

/* ---------- Background video ---------- */
.bg { position: absolute; inset: 0; z-index: -1; background: var(--deep); }
.bg video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}
/* Dark gradient so the text stays readable on every screen size */
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6, 21, 43, .55) 0%,
    rgba(6, 21, 43, 0) 24%,
    rgba(6, 21, 43, 0) 48%,
    rgba(6, 21, 43, .82) 100%
  );
}

/* ---------- Logo ---------- */
.top {
  display: flex;
  justify-content: center;
  padding: calc(clamp(16px, 3vh, 28px) + env(safe-area-inset-top, 0px)) 20px 0;
}
.logo { display: inline-block; line-height: 0; }
.logo img {
  display: block;
  width: auto;
  height: clamp(32px, 4.8vh, 46px);
  max-width: 70vw;
}

/* ---------- Text, form, icons ---------- */
.info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 20px calc(clamp(16px, 3vh, 30px) + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

h1 {
  margin: 0;
  max-width: 16ch;
  font: 700 clamp(2.1rem, 6.2vw, 4.1rem)/1.05 var(--font-head);
  letter-spacing: -.015em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(6, 21, 43, .7);
}

.sub {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(.95rem, 2.3vw, 1.15rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 14px rgba(6, 21, 43, .8);
}

/* Email pill */
.form {
  display: flex;
  align-items: center;
  width: min(560px, 100%);
  margin-top: 6px;
  padding: 4px;
  border: 1px solid rgba(233, 180, 76, .65);
  border-radius: 999px;
  background: rgba(6, 21, 43, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233, 180, 76, .22); }

.form-icon { flex: none; width: 20px; height: 20px; margin-left: 16px; color: var(--gold); }

.form input[type="email"] {
  flex: 1; min-width: 0; height: 48px;
  padding: 0 14px;
  border: 0; outline: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 16px;              /* 16px stops iOS from zooming on focus */
}
.form input::placeholder { color: rgba(255, 255, 255, .55); }

.form button {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #FFE29A, #E9B44C 55%, #C98E24);
  color: var(--navy);
  font: 600 1rem var(--font-body);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(233, 180, 76, .35);
  transition: box-shadow .2s, transform .2s;
}
.form button svg { width: 18px; height: 18px; }
.form button:hover { box-shadow: 0 8px 32px rgba(233, 180, 76, .6); transform: translateY(-1px); }
.form button:disabled { opacity: .7; cursor: progress; transform: none; }

.msg { max-width: 600px; margin: 0; font-size: .95rem; line-height: 1.45; text-shadow: 0 1px 10px rgba(6, 21, 43, .9); }
.msg:empty { display: none; }
.msg:not(:empty) + .note { display: none; }   /* the note and the status message share one slot */
.note { margin: 0; font-size: .8rem; color: rgba(255, 255, 255, .6); text-shadow: 0 1px 10px rgba(6, 21, 43, .9); }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }

/* Optional countdown */
.countdown { display: flex; gap: 10px; }
.countdown[hidden] { display: none; }
.countdown div {
  min-width: 68px; padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.countdown b { display: block; font: 700 1.5rem var(--font-head); color: var(--gold-light); }
.countdown span { font-size: .75rem; color: rgba(255, 255, 255, .75); }

/* Social icons (44px touch targets) */
.social { display: flex; gap: 14px; margin-top: 2px; }
.social a {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  color: var(--white); opacity: .88;
  transition: color .2s, opacity .2s, transform .2s;
}
.social a:hover { color: var(--gold); opacity: 1; transform: translateY(-2px); }
.social svg { width: 21px; height: 21px; }

.copy { margin: 0; font-size: .8rem; color: rgba(255, 255, 255, .65); }

.noscript { margin: 0; padding: 10px; text-align: center; background: var(--navy); font-size: .9rem; }

/* Keyboard focus */
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

/* ---------- One page-load reveal ---------- */
.rise { opacity: 0; animation: rise .9s ease forwards; }
.rise:nth-child(2) { animation-delay: .12s; }
.rise:nth-child(3) { animation-delay: .24s; }
.rise:nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */

/* Phones: stack the form */
@media (max-width: 520px) {
  .form { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; border-radius: 22px; }
  .form-icon { display: none; }
  .form input[type="email"] { height: 50px; padding: 0 16px; text-align: center; }
  .form button { width: 100%; height: 50px; }
  .countdown div { min-width: 60px; }
}

/* Short landscape phones: tighten spacing so everything stays reachable */
@media (max-height: 520px) and (orientation: landscape) {
  .info { gap: 8px; padding-top: 12px; }
  h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
  .sub { display: none; }
}

/* Wide screens: one-line headline and subline keep the text below the pen and waves */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  h1 { max-width: none; font-size: clamp(2.4rem, 4.2vw, 3.6rem); }
  .sub { max-width: 64ch; }
  .info { gap: 12px; }
}

/* Short laptop screens: tighter text block so it stays below the pen */
@media (min-aspect-ratio: 1/1) and (min-width: 900px) and (max-height: 820px) {
  h1 { font-size: clamp(2rem, 3.4vw, 2.8rem); }
  .info { gap: 8px; padding-top: 6px; }
  .form { margin-top: 2px; }
  .social { margin-top: 0; }
}

/* Portrait screens (phones, tablets): show the video as a banner on top so the whole
   scene is not cropped, and fade it into the page background where the text starts */
@media (max-aspect-ratio: 1/1) {
  .bg video { height: 66vh; height: 66svh; object-position: 50% 45%; }
  .bg::after {
    background: linear-gradient(
      to bottom,
      rgba(6, 21, 43, .55) 0%,
      rgba(6, 21, 43, 0) 18%,
      rgba(6, 21, 43, 0) 42%,
      var(--deep) 66%
    );
  }
}

/* Large screens */
@media (min-width: 1200px) { .info { gap: 16px; } }
@media (min-width: 1800px) {
  .logo img { height: 60px; }
  .info { padding-bottom: 48px; }
  .form { width: 620px; }
}

/* Respect reduced-motion settings (video is also paused in script.js) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise { opacity: 1; }
}
