/* Flux Hourglass — landing page.
   The page borrows the app's whole vocabulary: pure black, hairline type,
   letter-spaced capitals. The chrome stays grayscale; colour only appears
   inside the live materials (water, fire). */

:root {
  --void: #000;
  --grain: #f2f0ec;
  --ash: #a3a09a;
  --dust: #88857f;
  --hair: rgba(242, 240, 236, 0.12);
  --hair-2: rgba(242, 240, 236, 0.26);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1240px;
  color-scheme: dark;
}

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

html {
  background: var(--void);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--grain);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html[lang="ko"] [data-l="en"],
html[lang="en"] [data-l="ko"] {
  display: none !important;
}
html[lang="ko"] body {
  word-break: keep-all;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 1px solid var(--grain);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--grain);
  color: var(--void);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* Letter-spaced capitals, optically centred (see app.css). */
.sp {
  --ls: 0.5em;
  text-transform: uppercase;
  letter-spacing: var(--ls);
  margin-right: calc(-1 * var(--ls));
}

/* ------------------------------------------------------------------ bar */

.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 18px;
  font-size: 12px;
}
.brand {
  text-decoration: none;
  color: var(--ash);
  font-size: 11px;
}
.brand .sp {
  --ls: 0.6em;
}
.bar-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.bar-nav a,
.bar-nav button {
  color: var(--ash);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.bar-nav a:hover,
.bar-nav button:hover {
  color: var(--grain);
}

/* ----------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y; /* vertical swipes scroll; sideways drags draw walls */
  -webkit-user-select: none;
  user-select: none;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(96px + env(safe-area-inset-top, 0px)) var(--gutter) 0;
}
.headline {
  margin: 0 0 18px;
  max-width: 14ch;
  font-size: clamp(38px, 6.4vw, 88px);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
html[lang="ko"] .headline {
  max-width: 11em;
  font-size: clamp(32px, 5.2vw, 72px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.lede {
  margin: 0 0 28px;
  max-width: 38ch;
  color: var(--ash);
  font-size: clamp(15px, 1.25vw, 18px);
}
html[lang="ko"] .lede {
  max-width: 30em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  color: var(--grain);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
html[lang="ko"] .btn {
  letter-spacing: 0.04em;
  font-size: 14px;
}
.btn:hover {
  border-color: var(--grain);
}
.btn-solid {
  background: var(--grain);
  border-color: var(--grain);
  color: var(--void);
  font-weight: 400;
}
.btn-solid:hover {
  background: #fff;
}
.fine {
  margin: 14px 0 0;
  color: var(--dust);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* The word is the upper bulb; the stream leaks from beneath its centre. */
.word {
  position: relative;
  z-index: 1;
  /* Bottom margin keeps a minimum run of stream; spare height also lands
     below the word (the foot is pushed down by margin-top: auto). */
  margin: clamp(36px, 7vh, 72px) 0 clamp(140px, 22vh, 280px);
  padding: 0;
  text-align: center;
  font-size: clamp(34px, 10.4vw, 168px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  white-space: nowrap;
  color: var(--grain);
}
.word span {
  display: inline-block;
  animation: letter-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}
@keyframes letter-in {
  from {
    opacity: 0;
    transform: translateY(-0.18em);
    filter: blur(6px);
  }
}

/* Space reserved for the stream and the pile below the word. */
.hero-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter) calc(22px + env(safe-area-inset-bottom, 0px));
  mix-blend-mode: difference; /* readable on black and on the white pile */
  pointer-events: none;
}
.clock {
  margin: 0;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  color: #fff;
}
.clock-num {
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 200;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.clock-note {
  max-width: 21ch;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.75;
}
html[lang="ko"] .clock-note {
  max-width: 15em;
}
.hero-hint {
  margin: 0;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.75;
  text-align: right;
}
.hint-touch,
.tilt-btn {
  display: none;
}
@media (hover: none) {
  .hint-fine {
    display: none;
  }
  .hint-touch {
    display: inline;
  }
  .tilt-btn:not([hidden]) {
    display: inline-block;
  }
}
.tilt-btn {
  margin-left: 10px;
  padding: 6px 12px;
  border: 1px solid #fff;
  border-radius: 999px;
  pointer-events: auto;
  font-size: 11px;
  letter-spacing: 0.1em;
}

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

.section {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 14vw, 180px) var(--gutter) 0;
}
.section-head {
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section h2 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 60px);
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
html[lang="ko"] .section h2 {
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.sub {
  margin: 16px 0 0;
  max-width: 44ch;
  color: var(--ash);
}
html[lang="ko"] .sub {
  max-width: 34em;
}
.note {
  margin: 28px 0 0;
  color: var(--ash);
  font-size: 14px;
}
.note a {
  color: var(--grain);
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-2);
}
.note .sp {
  --ls: 0.3em;
  font-size: 12px;
  color: var(--grain);
}

.rise {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rise.in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------ materials */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.screen {
  position: relative;
  aspect-ratio: 9 / 17;
  border-radius: 26px;
  overflow: hidden;
  background: #000;
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.screen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* Hairline bezel drawn above the canvas. */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--hair);
  border-radius: inherit;
  pointer-events: none;
}
.card-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card-reveal .sp {
  --ls: 0.45em;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
}
.card-reveal b {
  font-weight: 300;
  font-size: clamp(20px, 2.2vw, 28px);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.screen.pressed .card-reveal {
  opacity: 1;
  transition-duration: 0.15s;
}
.card-name {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 400;
}
.card-name.sp {
  --ls: 0.55em;
}
.card p {
  margin: 0 0 14px;
  color: var(--ash);
  font-size: 14px;
  line-height: 1.55;
}
.card-link {
  margin-top: auto;
  align-self: flex-start;
  color: var(--grain);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--hair-2);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.card-link:hover {
  border-color: var(--grain);
}

/* ------------------------------------------------------------- gestures */

.verbs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 5vw, 80px);
}
.verb {
  padding: 30px 0 38px;
  border-top: 1px solid var(--hair);
}
.verb dt {
  margin-bottom: 14px;
  font-size: clamp(36px, 5.6vw, 76px);
  font-weight: 200;
  line-height: 1;
}
.verb dt.sp {
  --ls: 0.34em;
}
.nowrap {
  white-space: nowrap;
}
.verb dd {
  margin: 0;
  max-width: 36ch;
  color: var(--ash);
}
html[lang="ko"] .verb dd {
  max-width: 26em;
}

/* ---------------------------------------------------------- link board */

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--hair);
}
.row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) 2fr 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--hair);
}
.row-time {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.row-name {
  font-size: 17px;
}
.row-mat {
  color: var(--dust);
  font-size: 11px;
}
.row-mat.sp {
  --ls: 0.45em;
}
.row-actions {
  display: flex;
  gap: 8px;
}
.row-open,
.row-copy {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.row-open {
  background: var(--grain);
  border-color: var(--grain);
  color: var(--void);
}
.row-copy:hover {
  border-color: var(--grain);
}

/* -------------------------------------------------------------- privacy */

.ledger {
  margin: 0;
  max-width: 760px;
}
.ledger div {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--hair);
}
.ledger div:last-child {
  border-bottom: 1px solid var(--hair);
}
.ledger dt {
  flex: 1;
  color: var(--ash);
}
.ledger dd {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ledger small {
  margin-left: 6px;
  font-size: 12px;
  color: var(--ash);
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------ get */

.get-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
}
.get-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(28px, 3.4vw, 44px);
  border: 1px solid var(--hair);
  border-radius: 26px;
}
.get-card h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
}
.get-card h3.sp {
  --ls: 0.55em;
}
.get-card p {
  margin: 0 0 6px;
  max-width: 40ch;
  color: var(--ash);
}
.quiet {
  color: var(--ash);
  font-size: 13px;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-2);
}

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

.foot {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 12vw, 160px) var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px));
  color: var(--dust);
  font-size: 13px;
}
.versions {
  border-top: 1px solid var(--hair);
  padding: 18px 0;
}
.versions summary {
  cursor: pointer;
  color: var(--ash);
  letter-spacing: 0.06em;
}
.versions table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 13px;
}
.versions th,
.versions td {
  text-align: left;
  vertical-align: top;
  padding: 10px 16px 10px 0;
  border-top: 1px solid var(--hair);
}
.versions th {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.versions td {
  color: var(--ash);
}
.versions td:nth-child(2) {
  white-space: nowrap;
}
.versions a {
  color: var(--grain);
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}
.foot-links {
  display: flex;
  gap: 20px;
}
.foot a {
  color: var(--ash);
  text-decoration: none;
}
.foot a:hover {
  color: var(--grain);
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--grain);
  color: var(--void);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ----------------------------------------------------------- responsive */

/* Landscape screens: the word becomes a masthead, the stream falls the full
   height of the page, and the copy sits in the left half beside it. */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .hero {
    height: 100vh;
    height: 100svh;
    min-height: 640px;
  }
  .word {
    order: 0;
    margin: 0 -0.3em 0 0;
    padding: calc(76px + env(safe-area-inset-top, 0px)) 0 0;
    font-size: clamp(64px, min(10.4vw, 17vh), 168px);
  }
  .hero-copy {
    order: 1;
    padding-top: clamp(28px, 6vh, 72px);
  }
  .hero-copy > * {
    max-width: min(calc(50vw - var(--gutter) - 56px), 560px);
  }
  .headline {
    font-size: clamp(40px, min(4.8vw, 8vh), 80px);
  }
  html[lang="ko"] .headline {
    font-size: clamp(34px, min(3.9vw, 6.6vh), 64px);
  }
  .hero-foot {
    order: 2;
    margin-top: auto;
  }
}

@media (max-width: 1020px) {
  .cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .cards::-webkit-scrollbar {
    display: none;
  }
  .card {
    flex: 0 0 min(64vw, 300px);
    scroll-snap-align: start;
  }
}

@media (max-width: 760px) {
  .verbs,
  .get-grid {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "time name"
      "time mat"
      "act act";
    row-gap: 6px;
    column-gap: 20px;
  }
  .row-time {
    grid-area: time;
    align-self: center;
  }
  .row-name {
    grid-area: name;
    align-self: end;
  }
  .row-mat {
    grid-area: mat;
    align-self: start;
  }
  .row-actions {
    grid-area: act;
    margin-top: 10px;
  }
  .hero-copy {
    padding-top: calc(84px + env(safe-area-inset-top, 0px));
  }
  .hero-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hero-hint {
    text-align: left;
  }
  .clock-note {
    max-width: 24ch;
  }
  .versions td:nth-child(3) {
    min-width: 12em;
  }
  .versions {
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .bar-nav {
    gap: 16px;
  }
  .btn {
    padding: 0 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .word span {
    animation: none;
  }
  .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
