/* ==========================================================================
   The Ultra Deep — shared styles
   Future app pages (e.g. /story-ferry/) can link this file with
   <link rel="stylesheet" href="/styles.css"> and override the tokens below.
   ========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Surface */
  --bg-top: #1f1f23;
  --bg-bottom: #08080a;

  /* Type */
  --text: #ecebe8;
  --muted: #9d9da4;
  --accent: #b394c4; /* muted orchid */
  --line: rgba(236, 235, 232, 0.13);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --gutter: clamp(1.5rem, 7vw, 5.5rem);
  --measure: 70rem;
}

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

html {
  background: #08080a;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(179, 148, 196, 0.35);
  color: #fff;
}

/* ---------- Layout ---------- */

.stage {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3.5rem, 11vh, 8rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3.5rem, 10vh, 6rem);
}

/* Wide screens: wordmark on the left, the app slot anchored to its baseline on the right */
@media (min-width: 56rem) {
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 23rem);
    column-gap: clamp(3rem, 6vw, 6rem);
    align-content: center;
    align-items: end;
  }
}

/* ---------- Wordmark ---------- */

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(5.5rem, 32vw, 15rem);
  line-height: 0.84;
  letter-spacing: -0.025em;
  color: var(--text);
}

.wordmark span {
  display: block;
}

.wordmark__the {
  margin: 0 0 clamp(0.9rem, 2.4vw, 1.6rem) 0.12em;
  font-family: var(--sans);
  font-size: clamp(0.72rem, 1.5vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--muted);
}

.wordmark__ultra {
  margin-left: -0.035em; /* optical alignment of the serif U */
}

.wordmark__deep {
  font-style: italic;
  color: var(--accent);
  padding-right: 0.1em;
  margin-left: -0.01em;
}

/* ---------- Tagline ---------- */

.tagline {
  margin: clamp(2.25rem, 4.5vw, 3.25rem) 0 0;
  max-width: 30rem;
  text-wrap: balance;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Product placeholder ---------- */

.slot {
  width: min(100%, 26rem);
  min-height: 8.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(236, 235, 232, 0.015);
}

.slot__label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- App cards ---------- */

.apps {
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot--link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.slot--link:hover {
  border-color: rgba(179, 148, 196, 0.6);
  background: rgba(236, 235, 232, 0.03);
}

.slot--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.slot__name {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
}

.slot__line {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
}

.slot--more {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  border-style: dashed;
  background: transparent;
}

/* ---------- Footer ---------- */

.footer {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(1.75rem, 4vh, 2.75rem);
}

.footer p {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.credit {
  color: inherit;
  text-decoration: none;
}

.credit:hover,
.credit:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.credit__arrow {
  display: inline-block;
  margin-left: 0.15em;
  font-family: var(--sans);
  font-variant-emoji: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Gentle entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
  .wordmark,
  .tagline,
  .slot,
  .footer {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .tagline { animation-delay: 0.12s; }
  .slot    { animation-delay: 0.24s; }
  .slot--more { animation-delay: 0.32s; }
  .footer  { animation-delay: 0.4s; }

  @keyframes rise {
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 30rem) {
  .slot {
    min-height: 7rem;
    border-radius: 16px;
  }
  .slot--more {
    min-height: 4.25rem;
  }
}

@media (min-width: 56rem) {
  .slot {
    width: 100%;
    margin-bottom: 0.2rem; /* sits on the tagline's baseline */
  }
}
