/* adventure swim — single page
   Type sizes come from the 1672px-wide PSD (--u = 1 PSD pixel) and stay fixed.
   They only shrink once the screen is too narrow to fit them, and every size is
   continuous across breakpoints, so resizing never makes text jump. */

:root {
  --cream: #f6e0b9;
  --logo: #feecc9;
  --ember: #bc592f;
  --deep: #0f2322;

  --u: 1px;

  --serif: "Baskerville", "Libre Baskerville", "Baskerville Old Face", Georgia, serif;
  --display: "EB Garamond", "Garamond", "Baskerville", Georgia, serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--deep);
  color: var(--cream);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- background art ---------- */

.bg,
.bg img,
.shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg img {
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  animation: surface 1.6s ease-out both;
}

.shade {
  pointer-events: none;
  /* barely-there vignette so very wide screens don't look flat at the edges */
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(5, 14, 14, 0.35) 100%);
}

/* ---------- header ---------- */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(26 * var(--u)) calc(65 * var(--u)) 0 calc(67 * var(--u));
  padding-top: max(calc(26 * var(--u)), env(safe-area-inset-top));
}

.logo {
  font-family: var(--sans);
  font-weight: 500;
  font-size: calc(44 * var(--u));
  letter-spacing: 0.115em;
  word-spacing: 0.12em;
  line-height: 1;
  color: var(--logo);
  text-decoration: none;
  white-space: nowrap;
}

.logo .dot {
  color: var(--ember);
  letter-spacing: 0;
  margin-left: -0.08em;
}

.tag {
  margin: 0;
  font-size: calc(32 * var(--u));
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

/* ---------- pitch ---------- */

.pitch {
  position: absolute;
  z-index: 2;
  /* sits at the PSD's 50.3% line; slides left on narrower screens so the
     text block (~446px) always fits with a margin on the right */
  left: min(50.3%, calc(100% - 520px));
  top: 50.4%;
  transform: translateY(-50%);
  padding: calc(24 * var(--u)) 0 calc(26 * var(--u)) calc(44 * var(--u));
  border-left: 1px solid rgba(246, 224, 185, 0.72);
  animation: rise 1.2s 0.25s cubic-bezier(.2, .7, .2, 1) both;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: calc(51 * var(--u));
  line-height: 1.04;
  letter-spacing: 0.03em;
}

.ask {
  margin: calc(40 * var(--u)) 0 0;
  font-size: calc(24 * var(--u));
  line-height: 1.3;
  letter-spacing: 0.06em;
}

.mail {
  display: inline-flex;
  align-items: center;
  gap: calc(14 * var(--u));
  margin-top: calc(34 * var(--u));
  font-size: calc(24 * var(--u));
  letter-spacing: 0.06em;
  color: var(--cream);
  text-decoration: none;
}

.mail span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.08em;
}

.arrow {
  width: calc(26 * var(--u));
  height: auto;
  margin-top: 0.15em;
  transition: transform 0.35s cubic-bezier(.2, .7, .2, 1);
}

.mail:hover .arrow,
.mail:focus-visible .arrow { transform: translateX(6px); }

.mail:hover span { color: #fff3dc; }

.mail:focus-visible,
.logo:focus-visible {
  outline: 1px solid var(--ember);
  outline-offset: 6px;
}

/* ---------- phones and portrait tablets: stacked layout ----------
   Each size is min(desktop size, a share of the width): it stays at the
   desktop size until the screen is too narrow, then shrinks smoothly. */

@media (max-width: 900px), (orientation: portrait) and (max-width: 1024px) {
  body {
    display: flex;
    flex-direction: column;
  }

  .bg img {
    /* keep the diver in frame, light rays above him */
    object-position: 17% 50%;
  }

  .shade {
    background:
      linear-gradient(180deg,
        rgba(8, 20, 20, 0.55) 0%,
        rgba(8, 20, 20, 0.25) 22%,
        rgba(8, 20, 20, 0) 45%,
        rgba(8, 20, 20, 0) 70%,
        rgba(8, 20, 20, 0.45) 100%);
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: max(22px, env(safe-area-inset-top)) 22px 0;
    padding-left: max(22px, env(safe-area-inset-left));
    padding-right: max(22px, env(safe-area-inset-right));
  }

  .logo { font-size: clamp(18px, 5.6vw, 44px); }
  .tag { font-size: clamp(14px, 3.9vw, 32px); }

  .pitch {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: clamp(40px, 10vh, 110px) 22px 0 max(22px, env(safe-area-inset-left));
    padding: 6px 0 8px;
    border-left: 0;
    max-width: 30rem;
  }

  h1 { font-size: clamp(28px, 8.6vw, 51px); line-height: 1.06; }

  .ask { margin-top: 36px; font-size: clamp(16px, 4.3vw, 24px); text-wrap: balance; }
  .ask br { display: none; }

  .mail { margin-top: 20px; font-size: clamp(16px, 4.3vw, 24px); gap: 12px; }
  .arrow { width: 22px; }
}

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

@keyframes surface {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes rise {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bg img, .pitch { animation: none; }
  .arrow { transition: none; }
}
