/* ============================================================
   Unbarria Sky — landing page
   One "impressive sky" — a dense midsummer blue sky with towering
   cumulonimbus clouds (積乱雲) — lives ONLY in the hero. Everything below
   is quiet paper (the app's two-surface rule): ink on paper, with
   small daytime sky tiles standing in for real skies people share.
   ============================================================ */

:root {
  /* ink ramp — deep slate-blue, never pure black */
  --ink:      #24384a;
  --ink-92:   rgba(36, 56, 74, 0.92);
  --ink-64:   rgba(36, 56, 74, 0.64);
  --ink-48:   rgba(36, 56, 74, 0.48);
  --ink-hair: rgba(36, 56, 74, 0.13);

  /* paper surfaces (subtle warm / cool / bright rhythm) */
  --paper:        #eef2f4;
  --paper-warm:   #f4efe7;
  --paper-cool:   #e9f1f8;
  --paper-bright: #f7f9fb;

  /* sky blues (hero + tiles + footer haze) */
  --sky-deep: #1f66ad;
  --sky-mid:  #3f88c9;
  --sky-pale: #cfe1f0;

  /* on-photo ramp (hero white copy) */
  --on-1: #ffffff;
  --on-2: rgba(255, 255, 255, 0.82);
  --on-3: rgba(255, 255, 255, 0.66);

  /* type */
  --serif:       'Shippori Mincho', 'Hiragino Mincho ProN', 'YuMincho', serif;
  --serif-latin: 'Cormorant Garamond', 'Shippori Mincho', serif;
  --brand:       -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
                 'Noto Sans JP', system-ui, sans-serif;
  --sans:        'Noto Sans JP', -apple-system, BlinkMacSystemFont,
                 'Hiragino Kaku Gothic ProN', 'Helvetica Neue', system-ui, sans-serif;

  --edge:  clamp(22px, 6vw, 104px);
  --stack: clamp(92px, 14vw, 200px);
  --maxw:  1200px;
  --ease:  cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* -------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink-92);
  font-family: var(--sans); font-weight: 400; line-height: 1.95; letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
  font-synthesis: none;          /* never fake bold/italic while webfonts load */
  line-break: strict;            /* JP: no small kana / 長音 at line starts */
  font-kerning: normal;
}
svg, img { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(63, 136, 201, 0.24); }

/* -------------------------------------------------- type roles */
.kicker {
  font-family: var(--sans); font-weight: 500; font-size: 12px;
  letter-spacing: 0.34em; color: var(--ink-48); margin: 0 0 clamp(24px, 3vw, 38px);
}
.headline {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(25px, 4vw, 46px); line-height: 1.66; letter-spacing: 0.05em;
  font-feature-settings: "palt" 1; margin: 0;
  text-wrap: balance;            /* even line lengths when a headline must wrap */
  word-break: auto-phrase;       /* JP: break between phrases, not mid-word (Chrome) */
}
.verse {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(17px, 2vw, 23px); line-height: 2.15; letter-spacing: 0.1em;
  font-feature-settings: "palt" 1; color: var(--ink-64);
  text-wrap: balance; word-break: auto-phrase;
}
.body {
  font-size: clamp(14.5px, 1.35vw, 16.5px); line-height: 2.1;
  color: var(--ink-64); max-width: 36ch; font-weight: 400;
  text-wrap: pretty;             /* avoid one-character orphan lines */
  word-break: auto-phrase;       /* JP: wrap at 文節, never mid-phrase (Chrome/Edge) */
}
.col-copy .verse { margin: clamp(24px, 3vw, 34px) 0 0; }

/* -------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--edge); }
section { position: relative; }
[id] { scroll-margin-top: 72px; }   /* clear the fixed masthead when jumping to anchors */
.block { padding-block: var(--stack); }
.block__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(40px, 6vw, 96px); align-items: center;
}
.col-copy { max-width: 36rem; }
.tc { text-align: center; }
.mxauto { margin-left: auto; margin-right: auto; }
.tc .body, .tc .verse { margin-left: auto; margin-right: auto; }
.narrow { max-width: 38rem; }

/* paper surfaces */
.paper { position: relative; background: var(--paper); }
.paper--warm   { background: var(--paper-warm); }
.paper--cool   { background: var(--paper-cool); }
.paper--bright { background: var(--paper-bright); }

/* -------------------------------------------------- masthead */
.masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(15px, 2vw, 24px) var(--edge);
  transition: background .55s var(--ease), border-color .55s var(--ease), backdrop-filter .55s var(--ease);
  border-bottom: 1px solid transparent;
}
.masthead.solid {
  background: rgba(238, 242, 244, 0.82);
  backdrop-filter: blur(16px) saturate(1.15);
  border-bottom-color: var(--ink-hair);
}
.mh-mark {
  font-family: var(--brand); font-weight: 500;
  font-size: clamp(18px, 1.8vw, 22px); letter-spacing: 0.025em; line-height: 1;
  color: var(--on-1); text-shadow: 0 1px 18px rgba(8, 24, 48, 0.4);
  transition: color .55s var(--ease), text-shadow .55s var(--ease);
}
.brand-reg {
  display: inline-block;
  font-size: 0.58em;
  line-height: 1;
  margin-left: 0.04em;
  vertical-align: 0.46em;
}
.masthead.solid .mh-mark { color: var(--ink-92); text-shadow: none; }
.mh-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 12.5px; letter-spacing: 0.14em; color: var(--on-2);
  padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.4);
  transition: color .5s var(--ease), background .5s var(--ease), border-color .5s var(--ease);
}
.mh-link:hover { color: var(--on-1); background: rgba(255,255,255,0.16); }
.masthead.solid .mh-link { color: var(--ink-64); border-color: var(--ink-hair); }
.masthead.solid .mh-link:hover { color: var(--paper); background: var(--ink); border-color: var(--ink); }

/* -------------------------------------------------- scroll companion */
.sky-guide {
  position: fixed; left: 0; top: 0; z-index: 48; pointer-events: none;
  width: clamp(180px, 18vw, 290px);
  aspect-ratio: 920 / 812;
  opacity: 1;
  transform:
    translate3d(var(--guide-x, -180px), var(--guide-y, -190px), 0)
    rotate(var(--guide-tilt, -8deg))
    scale(var(--guide-scale, 1));
  transform-origin: 50% 35%;
  will-change: transform, opacity;
  overflow: visible;
  contain: layout style;
}
.sky-guide.is-visible { opacity: 1; }
.sky-guide__img {
  position: relative; z-index: 1;
  display: block; width: 100%; height: auto;
  opacity: var(--guide-primary-opacity, 1);
  animation: guide-float 6.6s ease-in-out infinite;
  filter:
    drop-shadow(0 2px 3px rgba(18, 38, 66, 0.18))
    drop-shadow(0 9px 12px rgba(18, 38, 66, 0.12));
}
.sky-guide__img--primary { position: relative; }
.sky-guide__img--watch {
  position: absolute; inset: 0;
  opacity: var(--guide-watch-opacity, 0);
}
.sky-cat {
  position: fixed; left: 0; top: 0; z-index: 68; pointer-events: none;
  width: clamp(156px, 15vw, 248px);
  aspect-ratio: 1643 / 957;
  opacity: var(--cat-opacity, 0);
  transform:
    translate3d(var(--cat-x, -260px), var(--cat-y, 120px), 0)
    rotate(var(--cat-tilt, -3deg))
    scale(var(--cat-scale, 1));
  transform-origin: 52% 42%;
  will-change: transform, opacity;
  overflow: visible;
  contain: layout style;
}
.sky-cat__img {
  display: block; width: 100%; height: auto;
  animation: guide-float 7.4s ease-in-out infinite;
  filter:
    drop-shadow(0 2px 3px rgba(18, 38, 66, 0.14))
    drop-shadow(0 8px 13px rgba(18, 38, 66, 0.1));
}
@keyframes guide-float {
  0%, 100% { transform: translateY(0) rotate(-0.7deg); }
  50% { transform: translateY(-4px) rotate(0.8deg); }
}
/* without JS the guide can never be positioned — keep it out of the way */
.no-js .sky-guide,
.no-js .sky-cat { display: none; }

/* -------------------------------------------------- hero */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; color: var(--on-1);
  background: linear-gradient(180deg, #0663c7 0%, #0c8ee8 58%, #53b9f4 100%);
}
.hero-art {
  position: absolute; inset: 0; z-index: 0;
  /* two layers on purpose: the top layer is nudged down 28px (crops the photo's
     bottom edge); the layer beneath fills the strip that nudge would expose */
  background-image:
    url("assets/hero-summer-cumulonimbus-photo.jpg"),
    url("assets/hero-summer-cumulonimbus-photo.jpg");
  background-color: #01409b;
  background-size: cover, cover;
  background-position: center calc(100% + 28px), center bottom;
  background-repeat: no-repeat, no-repeat;
}
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 68% 23%, rgba(0, 42, 110, 0.18) 0%, rgba(0, 42, 110, 0.08) 28%, rgba(0, 42, 110, 0) 58%),
    linear-gradient(180deg, rgba(0, 80, 170, 0.08) 0%, rgba(0, 80, 170, 0.02) 34%, rgba(0, 80, 170, 0) 58%);
}
.hero-inner {
  position: relative; z-index: 2; width: 100%; max-width: var(--maxw);
  margin-inline: auto; padding: clamp(84px, 12vh, 120px) var(--edge) clamp(96px, 14vh, 140px);
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
}
.hero-verse {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(27px, 4.35vw, 50px); line-height: 1.5; letter-spacing: 0.06em;
  font-feature-settings: "palt" 1; margin: 0; color: var(--on-1);
  text-shadow: 0 2px 28px rgba(3, 24, 58, 0.58), 0 1px 4px rgba(3, 24, 58, 0.46);
  width: min(100%, 34rem);
  word-break: auto-phrase;
}
.hero-sub {
  margin: clamp(22px, 3.4vw, 32px) 0 0; max-width: 34rem;
  font-size: clamp(14px, 1.4vw, 16.5px); line-height: 2.05; color: var(--on-1);
  text-shadow: 0 0 3px rgba(3, 24, 58, 0.9), 0 1px 3px rgba(3, 24, 58, 0.85), 0 2px 16px rgba(3, 24, 58, 0.55);
  width: min(100%, 34rem);
  word-break: auto-phrase;
}
.hero-scroll {
  position: absolute; left: 50%; bottom: clamp(22px, 4.2vh, 42px); transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: rgba(255, 255, 255, 0.74); font-size: 11.5px; font-weight: 400; letter-spacing: 0.26em; font-family: var(--sans);
  text-shadow:
    0 1px 2px rgba(5,18,42,0.64),
    0 0 10px rgba(5,18,42,0.34);
  transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.hero-scroll .rail {
  position: relative;
  width: 2px;
  height: clamp(36px, 5.6vh, 52px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 0 14px rgba(255,255,255,0.46),
    0 2px 14px rgba(5,18,42,0.44);
}
.hero-scroll .rail::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,0));
  animation: fall 2.8s var(--ease) infinite;
}
.hero-scroll:hover { transform: translateX(-50%) translateY(3px); }
@keyframes fall { 0% { transform: translateY(-100%) } 60%, 100% { transform: translateY(100%) } }

/* -------------------------------------------------- gate — the heart (paper) */
.gate-p { background: var(--paper-bright); }
.gate-p::before {   /* a soft high-sky wash bleeding down from the hero */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: clamp(160px, 26vw, 300px);
  background: linear-gradient(180deg, rgba(150, 192, 226, 0.5), transparent); pointer-events: none;
}
.gate-inner { min-height: 78vh; display: flex; align-items: center; }
.gate-head { position: relative; }
.gate-verse {
  display: block; margin-top: clamp(40px, 6vw, 72px);
  font-family: var(--serif); font-size: clamp(20px, 2.6vw, 30px); letter-spacing: 0.14em;
  color: var(--ink-92);
  opacity: 0; transform: translateY(10px); filter: blur(4px);
  transition: opacity 1.8s var(--ease), transform 1.8s var(--ease), filter 1.8s var(--ease);
}
.gate-verse.opened { opacity: 1; transform: none; filter: none; }
.no-js .gate-verse { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) { .gate-verse { transition: opacity .6s ease; } }

/* -------------------------------------------------- sky tiles (feed + widget) -->
   self-contained SVG (own blue gradient + cloud); container just frames it. */
.plate {
  position: relative; width: clamp(150px, 20vw, 214px); aspect-ratio: 3 / 4;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 22px 55px rgba(31, 74, 120, 0.22); border: 1px solid rgba(255,255,255,0.5);
}
.plate.solo { width: min(100%, 440px); aspect-ratio: 4 / 5; border-radius: 24px; margin-inline: auto; }
.plate .sky, .widget-tile .sky {
  position: absolute; inset: 0;
  /* sky-toned fallback: never an empty frame if JS fails, and a calm
     placeholder while the lazy photo loads */
  background: linear-gradient(180deg, var(--sky-mid), var(--sky-pale));
}
.plate .sky svg, .widget-tile .sky svg { width: 100%; height: 100%; }
/* photo tiles — real skies, matching the photographic hero */
.plate .sky img, .widget-tile .sky img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--tile-pos, 50% 38%);
}
/* caption backing only where a caption exists — uncaptioned photos stay clean */
.plate:has(figcaption)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; z-index: 2;
  pointer-events: none; background: linear-gradient(180deg, rgba(20,40,66,0) 0%, rgba(20,40,66,0.3) 100%);
}
.plate figcaption {
  position: absolute; left: 14px; bottom: 12px; z-index: 3;
  font-size: 11px; letter-spacing: 0.16em; color: #fff; font-family: var(--sans);
  text-shadow: 0 1px 2px rgba(16,34,58,0.85), 0 1px 10px rgba(16,34,58,0.5);
}
.plates { display: flex; gap: clamp(16px, 2.5vw, 30px); justify-content: center; align-items: center; flex-wrap: wrap; margin-top: clamp(48px, 7vw, 84px); }
.plates .plate:first-child { transform: translateY(14px) rotate(-1.4deg); }
.plates .plate:last-child  { transform: translateY(20px) rotate(1.4deg); }

/* the real app, framed as a quiet device — centrepiece of the feed row */
.phone { position: relative; z-index: 2; width: clamp(190px, 24vw, 264px); margin: 0; }
.phone__screen {
  border-radius: clamp(30px, 4.4vw, 42px); overflow: hidden;
  aspect-ratio: 639 / 1390;
  background: #10151c;
  padding: clamp(6px, 0.9vw, 9px);                 /* the bezel */
  box-shadow:
    0 34px 80px rgba(16, 34, 58, 0.34),
    0 4px 14px rgba(16, 34, 58, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.phone__screen img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: clamp(24px, 3.6vw, 34px);
}
.phone__cap {
  margin-top: 16px; text-align: center;
  font-size: 12px; letter-spacing: 0.12em; color: var(--ink-48); font-family: var(--sans);
}

/* widget tile on a light home-screen field */
.widget-stage { display: flex; justify-content: center; margin-top: clamp(40px, 6vw, 72px); }
.widget-field {
  position: relative; padding: clamp(30px, 5vw, 56px); border-radius: 34px;
  background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 26px 60px rgba(31, 74, 120, 0.16), inset 0 1px 0 rgba(255,255,255,0.8);
}
.widget-tile {
  position: relative; width: clamp(168px, 22vw, 210px); aspect-ratio: 1; border-radius: 26px; overflow: hidden;
  box-shadow: 0 18px 46px rgba(31, 74, 120, 0.26);
}
.widget-cap { margin-top: 14px; text-align: center; font-size: 12px; letter-spacing: 0.14em; color: var(--ink-64); font-family: var(--sans); }

/* -------------------------------------------------- buttons */
.cta-wrap { text-align: center; margin-top: clamp(44px, 6vw, 68px); }
.btn {
  display: inline-flex; align-items: center; gap: 12px; font-family: var(--sans);
  font-size: 15px; font-weight: 500; letter-spacing: 0.06em; padding: 17px 36px; border-radius: 999px; cursor: pointer;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), background .45s var(--ease);
}
.btn-ink { color: var(--paper); background: var(--ink); box-shadow: 0 14px 36px rgba(20,15,40,0.18); }
.btn-ink:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(20,15,40,0.24); }
.btn .apple { width: 17px; height: 20px; }
.cta-note { margin-top: 20px; font-size: 12px; letter-spacing: 0.1em; color: var(--ink-48); }

/* keyboard focus — visible on paper and on the sky hero */
.btn:focus-visible, .mh-link:focus-visible, .foot-nav a:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255,255,255,0.7);
}
.hero .mh-link:focus-visible, .masthead:not(.solid) .mh-link:focus-visible {
  outline-color: #fff; box-shadow: 0 0 0 5px rgba(10,28,54,0.5);
}

/* -------------------------------------------------- footer (pale high sky) */
.foot {
  position: relative; color: var(--ink-92);
  background: linear-gradient(180deg, #d7e6f2 0%, #e7eef3 46%, var(--paper) 100%);
}
.foot-inner { padding-top: clamp(96px, 15vw, 190px); padding-bottom: clamp(40px, 6vw, 64px); }
/* the app icon — introduces the app as you arrive at the download */
.app-icon {
  display: block; width: clamp(78px, 11vw, 104px); height: auto; aspect-ratio: 1;
  margin: 0 auto clamp(26px, 3.6vw, 38px); border-radius: 23.5%;   /* iOS superellipse-ish */
  box-shadow: 0 20px 44px rgba(24, 52, 92, 0.24), 0 3px 10px rgba(24, 52, 92, 0.16),
              inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.foot-head {
  font-family: var(--serif); font-weight: 500; text-align: center;
  font-size: clamp(24px, 4vw, 44px); line-height: 1.66; letter-spacing: 0.07em;
  margin: 0 auto; max-width: 20ch; color: var(--ink-92);
}
.foot-sub { text-align: center; margin: clamp(28px, 4vw, 40px) auto 0; max-width: 34ch; }
.foot-verse {
  text-align: center; margin: clamp(40px, 6vw, 64px) auto 0;
  font-family: var(--serif); font-size: clamp(18px, 2.2vw, 26px); letter-spacing: 0.12em; line-height: 2.1; color: var(--ink-92);
}
.foot-bar {
  margin-top: clamp(80px, 12vw, 140px); padding-top: 30px; border-top: 1px solid var(--ink-hair);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.foot-bar .mark {
  font-family: var(--brand); font-weight: 500; letter-spacing: 0.025em; font-size: 16px; line-height: 1;
}
.foot-nav { display: flex; gap: clamp(10px, 2vw, 22px); flex-wrap: wrap; align-items: center; }
.foot-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  font-size: 12.5px; letter-spacing: 0.08em; color: var(--ink-64); transition: color .4s var(--ease);
}
.foot-nav a:hover { color: var(--ink-92); }
.foot-copy { width: 100%; margin-top: 22px; font-size: 11.5px; letter-spacing: 0.08em; color: var(--ink-48); }

/* -------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .09s; } .d2 { transition-delay: .18s; } .d3 { transition-delay: .27s; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-scroll .rail::after { animation: none; }
  .sky-guide,
  .sky-cat { display: none; }
}

/* -------------------------------------------------- responsive */
@media (max-width: 860px) {
  .block__grid { grid-template-columns: 1fr; gap: clamp(28px, 7vw, 48px); }
  .col-copy, .body { max-width: none; }
  .plates .plate:first-child, .plates .plate:last-child { transform: none; }
  .plates { gap: 14px; }
}
@media (max-width: 680px) {
  /* feed row on phones: the app screen leads, the two skies pair beneath it */
  .plates { gap: 22px 12px; }
  .plates .phone { order: -1; flex: 0 0 auto; width: min(58vw, 210px); margin-inline: auto; flex-basis: 100%; display: flex; flex-direction: column; align-items: center; }
  .plates .phone .phone__screen { width: min(58vw, 210px); }
  .plates .plate { width: clamp(128px, 41vw, 154px); }
  .hero-art {
    background-size: cover, cover;
    background-position: 48% calc(100% + 22px), 48% bottom;
  }
  .hero-scrim {
    background:
      radial-gradient(ellipse at 22% 22%, rgba(0, 42, 110, 0.2) 0%, rgba(0, 42, 110, 0.1) 32%, rgba(0, 42, 110, 0) 62%),
      linear-gradient(180deg, rgba(0, 80, 170, 0.1) 0%, rgba(0, 80, 170, 0.04) 42%, rgba(0, 80, 170, 0) 68%);
  }
  .hero-inner { align-items: flex-end; }
  .hero-verse, .hero-sub { width: min(78vw, 34rem); max-width: min(78vw, 34rem); }
  .sky-guide { width: clamp(136px, 40vw, 174px); }
  .sky-cat { width: clamp(142px, 42vw, 178px); }
}
@media (max-width: 480px) {
  .hero-inner { padding-top: 84px; }
  .plate { width: clamp(128px, 42vw, 168px); }
  .sky-guide { width: 148px; }
  .sky-cat { width: 156px; }
  /* keep the scroll cue on phones — just a touch smaller */
  .hero-scroll { font-size: 10.5px; letter-spacing: 0.23em; }
}
