/* ==========================================================================
   Elsewhere — Landing Page
   Brand tokens derived from "Elsewhere Mood Board.pdf"
   ========================================================================== */

:root {
  /* Core palette */
  --ink:          #1A1916;   /* warm near-black, mood board cover */
  --ink-soft:     #2B2A25;
  --forest:       #1C3A32;   /* deep velvet green */
  --forest-deep:  #12251F;
  --sage:         #7E8F70;
  --sage-light:   #C7D6B4;
  --bone:         #F4F0E7;   /* cream paper */
  --cream:        #FBF8F2;
  --brass:        #B9955F;

  /* Semantic */
  --bg:              var(--bone);
  --surface:         var(--cream);
  --text:            var(--ink);
  --text-muted:      #5C5A52;
  --rule:            rgba(26, 25, 22, 0.14);
  --on-dark:         var(--bone);
  --on-dark-muted:   rgba(244, 240, 231, 0.80);
  --rule-dark:       rgba(244, 240, 231, 0.22);
  --focus:           var(--sage-light);

  /* Type */
  --font-display: "Cormorant Garamond", "Didot", "Baskerville", "Times New Roman", serif;
  --font-body:    "Jost", "Avenir Next", "Avenir", "Futura", "Helvetica Neue", system-ui, sans-serif;

  /* Rhythm */
  --pad-x: clamp(1.25rem, 5vw, 5rem);
  --section-y: clamp(4rem, 10vw, 8rem);
  --maxw: 68rem;

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

/* --------------------------------------------------------------- Reset */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.15; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------- Accessibility */

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-light :focus-visible,
.install:focus-visible { outline-color: var(--forest); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--bone);
  color: var(--ink);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* -------------------------------------------------------------- Brand */

/* Official stacked ELSE / WHERE lockup. The SVG is 670 x 186, so height is
   always width x 0.2776 — size these by width only. */
.logo {
  width: 100%;
  height: auto;
}

.hero__logo { margin: 0; line-height: 0; }

.logo--hero {
  /* Capped by viewport height too, so the hero still fits on short screens. */
  width: min(clamp(15rem, 64vw, 33rem), 74vh);
  /* Keeps the hairline serifs off the treetops behind them. */
  filter: drop-shadow(0 2px 20px rgba(6, 14, 11, 0.55));
}

.logo--foot { width: clamp(7rem, 18vw, 9rem); }

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin: 0;
}

/* ------------------------------------------------------------- Hero */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(1.75rem, 4vh, 3.5rem) var(--pad-x) clamp(1.25rem, 3vh, 2.25rem);
  color: var(--on-dark);
  background-color: var(--forest-deep);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  animation: heroDrift 28s var(--ease) forwards;
}
@keyframes heroDrift {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

/* Two-layer scrim: warms the photo toward the brand green and guarantees
   AA contrast for the type sitting on top of it. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%,
      rgba(10, 22, 18, 0.26) 0%,
      rgba(10, 22, 18, 0.62) 62%,
      rgba(8, 18, 15, 0.88) 100%),
    linear-gradient(180deg,
      rgba(10, 22, 18, 0.62) 0%,
      rgba(14, 30, 25, 0.24) 40%,
      rgba(10, 22, 18, 0.74) 100%),
    linear-gradient(0deg, rgba(28, 58, 50, 0.34), rgba(28, 58, 50, 0.34));
}

.hero__inner {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: var(--maxw);
  text-align: center;
  display: grid;
  gap: clamp(1.125rem, 2.6vh, 2rem);
  justify-items: center;
  padding-block: clamp(1rem, 3vh, 2rem);
}

.hero .eyebrow { color: var(--on-dark-muted); }

.hero__lockup { display: grid; gap: clamp(1.25rem, 3vh, 2rem); justify-items: center; }

.tagline {
  font-family: var(--font-display);
  font-size: min(clamp(1.125rem, 2.6vw, 1.75rem), 3.6vh);
  font-weight: 300;
  font-style: italic;
  line-height: 1.3;
  max-width: 30ch;
  color: var(--on-dark);
  text-shadow: 0 1px 14px rgba(6, 14, 11, 0.5);
}

.hero__rule {
  width: 3.5rem;
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--rule-dark);
}

.hero__copy {
  max-width: 38ch;
  color: var(--on-dark-muted);
  font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem);
}

/* -------------------------------------------------- App icon install CTA */

.install {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 1.5rem;
  -webkit-tap-highlight-color: transparent;
}

.install__tile {
  position: relative;
  width: min(clamp(5rem, 20vw, 7rem), 13vh);
  aspect-ratio: 1;
  border-radius: 23%;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(244, 240, 231, 0.22) inset,
    0 18px 40px -12px rgba(0, 0, 0, 0.65),
    0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.install__tile img { width: 100%; height: 100%; }

/* Sheen that sweeps across on hover — a small "tap me" affordance. */
.install__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.16) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 700ms var(--ease);
}
.install:hover .install__tile,
.install:focus-visible .install__tile { transform: translateY(-4px) scale(1.03); }
.install:hover .install__tile::after,
.install:focus-visible .install__tile::after { transform: translateX(120%); }
.install:active .install__tile { transform: translateY(0) scale(0.97); }

.install__label {
  display: grid;
  gap: 0.375rem;
  justify-items: center;
}
.install__name {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.install__hint {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  border-bottom: 1px solid var(--rule-dark);
  padding-bottom: 0.25rem;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.install:hover .install__hint,
.install:focus-visible .install__hint {
  color: var(--sage-light);
  border-color: var(--sage-light);
}

/* Status line under the CTA (installed / unsupported feedback) */
.install-status {
  min-height: 1.25rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--sage-light);
  text-align: center;
}

/* ------------------------------------------- Continue without installing */

.hero__alt { text-align: center; }

.hero__alt-link {
  display: inline-block;
  /* Padding rather than a height: it makes the tap target 44px without
     pushing the underline away from the text. */
  padding: 0.6875rem 0.5rem;
  color: var(--on-dark-muted);
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 var(--rule-dark);
  transition: color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.hero__alt-link:hover {
  color: var(--on-dark);
  box-shadow: inset 0 -1px 0 var(--on-dark);
}

/* Promoted once landing.js finds a live session — a returning user wants
   their dashboard, not a tutorial on installing something they already have. */
.hero__alt.is-signed-in .hero__alt-link {
  color: var(--sage-light);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -1px 0 var(--sage-light);
}

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

.hero__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--on-dark-muted);
  text-decoration: none;
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0.5rem;
  transition: color 200ms var(--ease);
}
.scroll-cue:hover { color: var(--on-dark); }
.scroll-cue__line {
  width: 1px;
  height: 2.25rem;
  background: linear-gradient(var(--rule-dark), transparent);
  animation: cueSlide 2.6s var(--ease) infinite;
}
@keyframes cueSlide {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); transform-origin: top; }
  50%      { opacity: 1;   transform: scaleY(1);   transform-origin: top; }
}

/* --------------------------------------------------------- Light sections */

.on-light {
  background: var(--bg);
  color: var(--text);
  padding: var(--section-y) var(--pad-x);
}
.shell { max-width: var(--maxw); margin-inline: auto; }

.section-head {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.section-head .eyebrow { color: #61735A; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  max-width: 20ch;
}
.section-head p {
  max-width: 46ch;
  color: var(--text-muted);
}

/* Install steps */

.steps {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  list-style: none;
  counter-reset: step;
}
.step {
  counter-increment: step;
  display: grid;
  gap: 0.625rem;
  align-content: start;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  position: relative;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: -0.75rem;
  left: 0;
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: #61735A;
  background: var(--bg);
  padding-right: 0.75rem;
}
.step h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
}
.step p { color: var(--text-muted); font-size: 0.9375rem; }

/* Platform switcher */

.tabs {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  padding: 0.25rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: fit-content;
  margin-inline: auto;
  background: var(--surface);
}
.tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.625rem 1.375rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--forest);
  color: var(--bone);
}

/* Text link */

.link {
  color: var(--forest);
  text-decoration: none;
  border-bottom: 1px solid var(--sage);
  padding-bottom: 0.125rem;
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.link:hover { color: var(--ink); border-color: var(--ink); }

.section-foot {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

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

.site-foot {
  background: var(--ink);
  color: var(--on-dark);
  padding: clamp(3rem, 7vw, 4.5rem) var(--pad-x);
}
.site-foot .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: end;
  justify-content: space-between;
}
.site-foot .eyebrow { color: var(--on-dark-muted); margin-top: 1rem; }
.foot-meta {
  font-size: 0.8125rem;
  color: var(--on-dark-muted);
  text-align: right;
  display: grid;
  gap: 0.375rem;
}
@media (max-width: 34rem) {
  .site-foot .shell { flex-direction: column; align-items: start; }
  .foot-meta { text-align: left; }
}

/* -------------------------------------------------------------- Dialog */

dialog.sheet {
  border: 0;
  padding: 0;
  max-width: min(30rem, calc(100vw - 2rem));
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border-radius: 0.5rem;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}
dialog.sheet::backdrop { background: rgba(18, 37, 31, 0.62); }

.sheet__body { padding: clamp(1.75rem, 5vw, 2.5rem); display: grid; gap: 1.25rem; }
.sheet__body h2 { font-family: var(--font-display); font-size: 1.625rem; }
.sheet__body .eyebrow { color: #61735A; }
.sheet__body ol { display: grid; gap: 0.75rem; padding-left: 1.25rem; }
.sheet__body li { font-size: 0.9375rem; color: var(--text-muted); }
.sheet__body li strong { color: var(--text); font-weight: 500; }

.sheet__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; }

.btn {
  appearance: none;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: var(--bone);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.btn:hover { background: var(--forest-deep); border-color: var(--forest-deep); }
.btn--ghost { background: none; color: var(--forest); }
.btn--ghost:hover { background: rgba(28, 58, 50, 0.07); color: var(--forest); border-color: var(--forest); }

/* --------------------------------------------------------- Reveal on scroll */

[data-reveal] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}

/* Windows High Contrast / forced colors */
@media (forced-colors: active) {
  .install__tile, .btn, .tab { forced-color-adjust: none; }
  .hero__media::after { display: none; }
}
