/* Melyro home page. The Sinyal language (docs/design/sinyal/DESIGN.md in melyro-ios) on the web:
   a warm near-black room, cream ink, one colour. Dark only, as the app is.
   Kor is the moment: the lamp, the now line, a focus ring. Never a button's fill; the action is cream.
   Radii: cells 28px, plates 16px, actions are capsules, devices follow their own glass. */

:root {
  --canvas: #0D0C0B;
  --surface: #181614;
  --elevated: #24211D;
  --kor: #FF6B3D;
  --cream: #F5F1EA;
  --ink2: #A9A198;
  --ink3: #918980;
  --divider: #2A2622;
  --hairline: #3A352F;
  --outline: #756E65;

  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 24px;
  --max: 1240px;
  --pad: max(var(--gutter), calc((100% - var(--max)) / 2));
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r-cell: 28px;
  --r-plate: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
body.home {
  margin: 0;
  background: var(--canvas);
  color: var(--cream);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }

/* One family, three widths: headings are the expanded cut of the system font. */
h1, h2, h3, .wm {
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.ic { width: 1.25em; height: 1.25em; flex: none; }
.ic-btn { width: 1.1em; height: 1.1em; }
.ic-xl { width: 44px; height: 44px; }

:focus-visible { outline: 2px solid var(--kor); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  background: var(--cream); color: var(--canvas); padding: 10px 16px; border-radius: 999px;
}
.skip:focus { top: 12px; }

/* Wordmark: the app's "melyro" with the lamp at its shoulder. */
.wm { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.lamp {
  display: inline-block; width: .27em; height: .27em; margin-left: .07em;
  border-radius: 50%; background: var(--kor); transform: translateY(-.6em);
}

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgb(13 12 11 / .74);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgb(42 38 34 / .7);
}
.bar-in {
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding-inline: var(--pad);
}
.brand { text-decoration: none; color: var(--cream); }
.bar nav { display: flex; gap: 26px; margin-left: 12px; }
.bar nav a, .foot nav a { color: var(--ink2); text-decoration: none; font-size: .95rem; transition: color .2s; }
.bar nav a:hover, .foot nav a:hover { color: var(--cream); }
.langs { display: flex; gap: 12px; margin-left: auto; font-size: .85rem; color: var(--ink3); letter-spacing: .02em; }
.langs a { color: var(--ink3); text-decoration: none; }
.langs a:hover { color: var(--cream); }
.langs strong { color: var(--cream); font-weight: 600; }

/* Actions: cream is the action. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 52px; padding: 0 26px; border-radius: 999px;
  font: 600 1rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--cream); color: var(--canvas); }
.btn-primary:hover { background: #FFFAF2; }
.btn-ghost { background: var(--elevated); color: var(--cream); }
.btn-ghost:hover { background: #2E2A25; }
.btn-ghost .ic { transition: transform .3s var(--ease); }
.btn-ghost:hover .ic { transform: translateX(3px); }
.btn-small { height: 38px; padding: 0 18px; font-size: .92rem; }

/* Devices: a plain outline round the real screen, as on the App Store images. */
.phone, .tablet, .phone-land { container-type: inline-size; }
.dev { position: relative; }
.phone .dev {
  padding: 2.6cqw; border-radius: 16cqw;
  background: linear-gradient(160deg, #34302B, #161412 40%, #100F0D);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07), 0 50px 90px -30px rgb(0 0 0 / .8);
}
.phone img { width: 100%; border-radius: 13.4cqw; }
.phone .island {
  position: absolute; left: 50%; top: calc(2.6cqw + 2.6cqw); transform: translateX(-50%);
  width: 29.5cqw; height: 8.6cqw; border-radius: 99px; background: #050505;
}
.tablet .dev {
  padding: 2.2cqw; border-radius: 4.2cqw;
  background: linear-gradient(160deg, #34302B, #161412 40%, #100F0D);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07), 0 50px 100px -30px rgb(0 0 0 / .85);
}
.tablet img { width: 100%; border-radius: 2.1cqw; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); align-items: center; gap: 48px;
  min-height: min(calc(100dvh - 64px), 920px);
  padding: 72px var(--pad) 96px;
}
.hero h1 { font-size: clamp(2.1rem, var(--h1v, 5vw), var(--h1max, 4.5rem)); line-height: 1.02; letter-spacing: -0.04em; }
.hero h1 span { display: block; }
.hero h1 .l2 { color: var(--ink2); }
.now { width: min(360px, 70%); height: 3px; margin: 34px 0 30px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.now span { display: block; height: 100%; width: 62%; border-radius: 3px; background: var(--kor); }
.hero-sub { font-size: 1.2rem; line-height: 1.5; color: var(--ink2); max-width: 31em; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-art { position: relative; height: clamp(460px, 48vw, 660px); }
.hero-art .tablet { position: absolute; right: 0; top: 0; width: 82%; }
.hero-art .hero-phone { position: absolute; left: 2%; bottom: -2%; width: 39%; z-index: 1; }

/* Sources: three big rows, not three cards. */
.sources, .features, .privacy, .pro, .end, .land { padding: 120px var(--pad); }
section h2 { font-size: clamp(2rem, 4.3vw, 3.7rem); line-height: 1.04; letter-spacing: -0.035em; max-width: 17ch; margin-bottom: 56px; }
section h2.two { max-width: none; }
section h2.two span { display: block; }
section h2.two span + span { color: var(--ink2); }
.src-list { border-top: 1px solid var(--divider); }
.src {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 24px;
  padding: 36px 0; border-bottom: 1px solid var(--divider);
}
.src-ic {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-plate);
  background: var(--surface); border: 1px solid var(--divider); color: var(--ink2);
}
.src-ic .ic { width: 28px; height: 28px; }
.src h3 { position: relative; font-size: clamp(1.6rem, 3.1vw, 2.6rem); line-height: 1.1; letter-spacing: -0.03em; justify-self: start; padding-bottom: 8px; }
.src h3::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; border-radius: 3px;
  background: var(--kor); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.src:hover h3::after { transform: scaleX(1); }
.src p { color: var(--ink2); font-size: 1.05rem; max-width: 34em; }
.note {
  display: flex; gap: 16px; align-items: flex-start; max-width: 860px; margin-top: 48px;
  padding: 22px 26px; border-radius: var(--r-plate); background: var(--surface); border: 1px solid var(--divider);
}
.note .ic { width: 26px; height: 26px; color: var(--ink2); margin-top: 1px; }
.note p { color: var(--ink2); }
.note strong { color: var(--cream); font-weight: 600; }

/* Features: six cells, six different shapes. */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cell {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-cell); background: var(--surface); border: 1px solid var(--divider);
  padding: 40px;
}
.cell h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.12; letter-spacing: -0.03em; }
.cell p { color: var(--ink2); margin-top: 12px; max-width: 30em; }
.cell .phone, .cell .tablet { transition: transform .9s var(--ease); }
.cell:hover .rise { transform: translateY(-10px); }

.c-live { grid-column: 1 / 4; grid-row: span 2; display: flex; flex-direction: column; }
.c-live .phone { width: min(64%, 330px); margin: 44px auto -26%; }

.c-player, .c-series, .c-search {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 24px; min-height: 360px; padding-bottom: 0;
}
.c-player { grid-column: 4 / 7; }
.c-series { grid-column: 4 / 7; }
.c-search { grid-column: 3 / 7; grid-template-columns: minmax(0, 1fr) minmax(0, .62fr); }
.cell .peek { align-self: start; width: 100%; max-width: 250px; justify-self: end; margin-bottom: -60%; }

.c-ipad { grid-column: 1 / 7; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; padding-bottom: 0; height: 560px; }
.c-ipad .cell-txt { padding-top: 24px; }
.tablet-cell { margin-bottom: -22%; }
.c-ipad:hover .tablet-cell { transform: translateY(-10px); }

.c-cast {
  grid-column: 1 / 3; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  background: var(--elevated); border-color: var(--hairline);
}
.cast-icons { display: flex; gap: 22px; color: var(--cream); }

/* Landscape: the phone turns as the page scrolls, which is what the section asks of you. */
.land { text-align: center; padding-bottom: 140px; }
.land-copy h2 { margin: 0 auto 18px; max-width: 18ch; }
.land-copy p { color: var(--ink2); font-size: 1.15rem; max-width: 36em; margin: 0 auto; }
.land-stage { margin-top: 100px; }
.phone-land { width: min(1060px, 100%); margin: 0 auto; }
.phone-land .dev {
  padding: 1.25cqw; border-radius: 4.3cqw;
  background: linear-gradient(160deg, #34302B, #161412 40%, #100F0D);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07), 0 60px 120px -40px rgb(0 0 0 / .9);
}
.phone-land img { width: 100%; border-radius: 3.2cqw; }
.phone-land .island {
  position: absolute; top: 50%; left: calc(1.25cqw + 1.2cqw); transform: translateY(-50%);
  width: 4cqw; height: 13.6cqw; border-radius: 99px; background: #050505;
}

/* Privacy: the statement is the design. */
.privacy { text-align: center; }
.privacy h2 { font-size: clamp(2.6rem, 6.4vw, 5.8rem); line-height: 1; letter-spacing: -0.045em; max-width: none; margin-bottom: 32px; }
.privacy h2 span { display: block; }
.privacy h2 span + span { color: var(--ink2); }
.privacy p { color: var(--ink2); font-size: 1.2rem; max-width: 34em; margin: 0 auto; }
.link {
  display: inline-flex; align-items: center; gap: .45em; margin-top: 28px;
  color: var(--cream); text-decoration: underline; text-decoration-color: var(--hairline);
  text-underline-offset: 6px; text-decoration-thickness: 1px; transition: text-decoration-color .2s;
}
.link:hover { text-decoration-color: var(--cream); }

/* Pro */
.pro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 72px; align-items: center; }
.pro h2 { margin-bottom: 18px; }
.pro-sub { color: var(--ink2); font-size: 1.12rem; max-width: 34em; }
.pro-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; margin-top: 52px; }
.pro-list li { display: flex; gap: 16px; }
.pro-list .ic { width: 26px; height: 26px; color: var(--ink2); margin-top: 2px; }
.pro-list h3 { font-size: 1.08rem; letter-spacing: -0.015em; }
.pro-list p { color: var(--ink2); font-size: .97rem; margin-top: 4px; }
.pro-art { max-height: 500px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.pro-art .phone { width: min(100%, 330px); margin: 0 auto; }

/* End */
.end { text-align: center; padding-bottom: 140px; }
.end-mark { width: 112px; height: 112px; border-radius: 25px; margin: 0 auto 36px; box-shadow: 0 24px 48px -24px rgb(255 107 61 / .3); }
.end h2 { margin: 0 auto 16px; max-width: 20ch; }
.end p { color: var(--ink2); font-size: 1.1rem; margin-bottom: 32px; }

/* Footer */
.foot { border-top: 1px solid var(--divider); padding: 40px var(--pad) 48px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 22px; }
.tm { color: var(--ink3); font-size: .82rem; margin-top: 20px; max-width: 60em; }
.tm + .tm { margin-top: 6px; }

/* Motion. Off for anyone who asks for less. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .bar .lamp { animation: lamp-on 1.4s .2s var(--ease) both; }
  .hero h1 .l1 { animation: rise 1s .15s var(--ease) both; }
  .hero h1 .l2 { animation: rise 1s .27s var(--ease) both; }
  .now span { animation: now 1.8s .6s var(--ease) both; }
  .hero-sub { animation: rise 1s .4s var(--ease) both; }
  .ctas { animation: rise 1s .5s var(--ease) both; }
  .hero-art .tablet { animation: drift-in 1.3s .25s var(--ease) both; }
  .hero-art .hero-phone { animation: lift-in 1.3s .45s var(--ease) both; }

  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .bento > :nth-child(2) { transition-delay: .08s; }
  .js .bento > :nth-child(3) { transition-delay: .16s; }
  .js .pro-list > :nth-child(2n) { transition-delay: .08s; }

  @supports (animation-timeline: view()) {
    .phone-land {
      animation: turn linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 50%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes drift-in { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes lift-in { from { opacity: 0; transform: translateY(70px); } to { opacity: 1; transform: none; } }
@keyframes now { from { width: 0; } to { width: 62%; } }
@keyframes lamp-on {
  0% { opacity: 0; box-shadow: 0 0 0 0 rgb(255 107 61 / 0); }
  45% { opacity: 1; box-shadow: 0 0 0 .32em rgb(255 107 61 / .28); }
  100% { opacity: 1; box-shadow: 0 0 0 .7em rgb(255 107 61 / 0); }
}
/* Scale stays small while the angle is large, so the turning phone never reaches the copy above. */
@keyframes turn {
  0% { transform: rotate(-90deg) scale(.42); }
  50% { transform: rotate(-35deg) scale(.62); }
  100% { transform: none; }
}

/* Tablet and down */
@media (max-width: 980px) {
  .hero h1 { font-size: min(var(--h1max), calc(var(--h1v) * 2.05)); }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; min-height: 0; }
  .hero-art { height: auto; aspect-ratio: 1 / .92; max-width: 640px; width: 100%; margin: 0 auto; }
  .bar nav { display: none; }
  .pro { grid-template-columns: 1fr; gap: 56px; }
  .c-live { grid-column: 1 / 7; grid-row: auto; }
  .c-player, .c-series { grid-column: span 3; }
  .c-cast { grid-column: 1 / 7; }
  .c-search { grid-column: 1 / 7; }
}

/* Phone */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body.home { font-size: 16px; }
  .bar-in { gap: 14px; }
  .langs { gap: 10px; }
  .sources, .features, .privacy, .pro, .end, .land { padding-top: 80px; padding-bottom: 80px; }
  section h2 { margin-bottom: 36px; }
  .hero { padding-top: 40px; padding-bottom: 64px; }
  .hero-sub { font-size: 1.08rem; }
  .ctas .btn { flex: 1 1 100%; }
  .src { grid-template-columns: 56px minmax(0, 1fr); gap: 8px 18px; padding: 28px 0; }
  .src-ic { width: 48px; height: 48px; grid-row: span 2; align-self: start; }
  .src p { grid-column: 2; }
  .bento { grid-template-columns: 1fr; }
  .cell, .c-live, .c-player, .c-series, .c-search, .c-cast, .c-ipad { grid-column: 1 / -1; padding: 28px; }
  .c-player, .c-series, .c-search, .c-ipad { grid-template-columns: 1fr; min-height: 0; padding-bottom: 0; }
  .cell .peek { justify-self: center; max-width: 230px; margin-bottom: -48%; }
  .c-ipad { gap: 28px; }
  .c-ipad .cell-txt { padding-top: 0; }
  .c-live .phone { width: 72%; margin-bottom: -40%; }
  .pro-list { grid-template-columns: 1fr; gap: 26px; }
  .land-stage { margin-top: 48px; }
  .btn-small { display: none; }
}
