/* Tegamie のホームページ。色・書体・角丸はアプリ（lib/app/palette.dart）に合わせている。 */

:root {
  --red: #d0342a;
  --red-shade: #b92d24;
  --red-dark: #a3271f;
  --red-deep: #5a1611;
  --navy: #1e2a4a;
  --cream: #f7f0e1;
  --paper-white: #fffbf2;
  --mustard: #e2a93b;
  --sand: #c9bb98;
  --line: #d9cbaa;
  --ink-soft: #5b5f6e;

  --f-display: "Dela Gothic One", "Hiragino Kaku Gothic StdN", "Hiragino Sans", sans-serif;
  --f-ui: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-letter: "Klee One", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --gutter: clamp(24px, 5vw, 72px);
  --sheet-r: 36px;
  --measure: 34em;

  /* 丸ポストの色（深夜だけ少し沈む） */
  --post-body: var(--red);
  --post-shade: var(--red-shade);
  --post-dark: var(--red-dark);
  --post-slot: var(--red-deep);
  --post-trim: var(--cream);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

svg {
  display: block;
}

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

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

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

h2.display {
  font-size: clamp(27px, 3.6vw, 44px);
}

.lead {
  max-width: var(--measure);
  font-size: clamp(16px, 1.25vw, 18px);
}

/* ---- 丸ポスト（symbol #post の中身。色は使う側の変数で決まる） ---- */
.p-body { fill: var(--post-body); }
.p-shade { fill: var(--post-shade); }
.p-dark { fill: var(--post-dark); }
.p-slot { fill: var(--post-slot); }
.p-trim { fill: var(--post-trim); }
.p-mark {
  fill: none;
  stroke: var(--post-trim);
  stroke-width: 6;
  stroke-linecap: round;
}

/* ---- 時間帯ごとの空（朝・昼間・夕方・夜・深夜） ---- */
.sky,
.sky[data-part="day"] {
  --sky: #bcd8d0;
  --disc: #f7f0e1;
  --crater: #f7f0e1;
  --cloud: #d6e8e2;
  --town: #9fc6bd;
  --window: #bcd8d0;
  --window-lit: #bcd8d0;
  --disc-y: 200;
  --crater-o: 0;
  --cloud-o: 1;
  --star-o: 0;
  --crescent-o: 0;
  --lamp-o: 0;
  --bird-o: 0;
  --on-sky: var(--navy);
  --on-sky-soft: rgba(30, 42, 74, 0.82);
  --chip: var(--paper-white);
  --on-chip: var(--navy);
  --nav-active: var(--red-dark);
  --nav-active-bg: #f1cfc6;
}

.sky[data-part="morning"] {
  --sky: #f7d6bd;
  --disc: #fff3d6;
  --crater: #fff3d6;
  --cloud: #fbe8d6;
  --town: #e7b694;
  --window: #f7d6bd;
  --window-lit: #f7d6bd;
  --disc-y: 262;
  --bird-o: 1;
}

.sky[data-part="evening"] {
  --sky: #ee9f7b;
  --disc: #fbe2a6;
  --crater: #fbe2a6;
  --cloud: #f5bc9c;
  --town: #b9604f;
  --window: #fbe2a6;
  --window-lit: #fbe2a6;
  --disc-y: 250;
}

.sky[data-part="night"] {
  --sky: #2f3e6e;
  --disc: #f3e7b8;
  --crater: #e6d79e;
  --cloud: #3d4e82;
  --town: #1e2a4a;
  --window: var(--mustard);
  --window-lit: var(--mustard);
  --disc-y: 200;
  --crater-o: 1;
  --star-o: 1;
  --on-sky: var(--paper-white);
  --on-sky-soft: rgba(255, 251, 242, 0.84);
  --chip: #1e2a4a;
  --on-chip: var(--paper-white);
  --nav-active: #f5a196;
  --nav-active-bg: #4a2a3a;
}

.sky[data-part="midnight"] {
  --sky: #10162b;
  --disc: #1a2242;
  --crater: #1a2242;
  --cloud: #10162b;
  --town: #0a0f20;
  --window: #1a2242;
  --window-lit: var(--mustard);
  --disc-y: 214;
  --cloud-o: 0;
  --star-o: 1;
  --crescent-o: 1;
  --lamp-o: 1;
  --on-sky: #f1ebdd;
  --on-sky-soft: rgba(241, 235, 221, 0.82);
  --chip: #1e2747;
  --on-chip: #f1ebdd;
  --nav-active: #f5a196;
  --nav-active-bg: #3d2230;
  --post-body: var(--red-shade);
  --post-shade: var(--red);
  --post-dark: #8e2019;
  --post-slot: #3f0f0c;
  --post-trim: #f1ebdd;
}

.sky {
  background: var(--sky);
  color: var(--on-sky);
}

/* 風景の部品 */
.scene {
  overflow: visible;
}

.s-disc { fill: var(--disc); }
.s-crater { fill: var(--crater); opacity: var(--crater-o); }
.s-cloud { fill: var(--cloud); opacity: var(--cloud-o); }
.s-star { fill: var(--post-trim); opacity: var(--star-o); }
.s-crescent { opacity: var(--crescent-o); }
.s-town { fill: var(--town); }
.s-window { fill: var(--window); }
.s-window-lit { fill: var(--window-lit); }
.s-lamp { opacity: var(--lamp-o); }
.s-bird {
  fill: none;
  stroke: var(--navy);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: calc(var(--bird-o) * 0.5);
}
.s-disc-group {
  transform: translateY(calc((var(--disc-y) - 200) * 1px));
}

/* 時間帯を切り替えたときは、アプリと同じようになめらかに移る */
.hero,
.hero .s-disc,
.hero .s-crater,
.hero .s-cloud,
.hero .s-star,
.hero .s-crescent,
.hero .s-town,
.hero .s-window,
.hero .s-window-lit,
.hero .s-lamp,
.hero .s-bird,
.hero .s-disc-group,
.hero .bubble-bg,
.hero .bubble-text {
  transition: background-color 0.9s ease, color 0.9s ease, fill 0.9s ease,
    opacity 0.9s ease, transform 0.9s cubic-bezier(0.3, 0, 0.2, 1);
}

/* ---- ヘッダー ---- */
.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter) 0;
}

.wordmark {
  font-family: var(--f-display);
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  color: inherit;
}

.site-nav {
  display: none;
  gap: 28px;
  font-weight: 700;
  font-size: 15px;
}

.site-nav a {
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: currentColor;
}

@media (min-width: 720px) {
  .site-nav {
    display: flex;
  }
}

/* ---- ヒーロー（アプリのホームと同じ風景） ---- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-bottom: var(--sheet-r);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: clamp(28px, 6svh, 64px) var(--gutter) 28px;
}

.greeting {
  font-size: clamp(32px, 10vw, 46px);
  transition: opacity 0.2s ease;
}

.greeting span {
  display: block;
  white-space: nowrap;
}

.greeting.is-swapping {
  opacity: 0;
}

.hero-lead span {
  display: inline-block;
}

.hero-lead {
  margin-top: 18px;
  max-width: 26em;
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 700;
  color: var(--on-sky-soft);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 9px 18px 9px 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--on-chip);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  transition: background-color 0.9s ease, color 0.9s ease;
}

.status-chip::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.daypart {
  margin-top: 24px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.daypart legend {
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-sky-soft);
}

.daypart-options {
  display: inline-flex;
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--chip);
  transition: background-color 0.9s ease;
}

.daypart-options label {
  position: relative;
  cursor: pointer;
}

.daypart-options input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.daypart-options span {
  display: block;
  min-width: 46px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--on-chip);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.daypart-options input:checked + span {
  background: var(--nav-active-bg);
  color: var(--nav-active);
}

.daypart-options input:focus-visible + span {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}

.hero-scene {
  position: relative;
  z-index: 1;
  margin-top: auto;
  width: 100%;
  height: min(48svh, 92vw, 520px);
}

.hero-scene .scene {
  width: 100%;
  height: 100%;
}

.cloud-drift {
  animation: drift 46s ease-in-out infinite alternate;
}

.cloud-drift--slow {
  animation-duration: 70s;
  animation-direction: alternate-reverse;
}

@keyframes drift {
  from { transform: translateX(-14px); }
  to { transform: translateX(22px); }
}

/* 投函の演出: 封筒が飛んできてポストに入り、吹き出しが出る */
.fly-trail {
  fill: none;
  stroke: var(--paper-white);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.1 12;
  opacity: 0;
}

.fly {
  opacity: 0;
}

.bubble {
  transform-box: fill-box;
  transform-origin: 0% 60%;
}

.bubble-bg { fill: var(--chip); }
.bubble-text {
  fill: var(--on-chip);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 12.5px;
}
.bubble-chevron {
  fill: none;
  stroke: var(--on-chip);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.js .hero .mail,
.js .hero .bubble {
  opacity: 0;
}

.js .hero .bubble {
  transform: scale(0.7);
}

.js .hero.is-flying .fly { opacity: 1; }

.js .hero.is-landed .mail {
  opacity: 1;
}

.js .hero.is-landed .bubble {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease 0.35s,
    transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) 0.35s;
}

@media (min-width: 1100px) {
  .hero {
    min-height: max(100svh, 700px);
  }

  .hero-copy {
    max-width: 46vw;
    padding-top: clamp(40px, 9svh, 96px);
  }

  .greeting {
    font-size: clamp(50px, 4.6vw, 72px);
  }

  .hero-scene {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--sheet-r);
    height: min(66svh, 620px);
    transform: translateX(clamp(160px, 17vw, 300px));
  }
}

/* ---- 下から重なるシート（アプリの下のシートと同じ角丸） ---- */
.sheet {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--sheet-r) * -1);
  border-radius: var(--sheet-r) var(--sheet-r) 0 0;
  background: var(--cream);
  color: var(--navy);
}

.sheet-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
}

/* ---- 一通の手紙（便箋と切手をえらべる） ---- */
.letter-demo {
  --paper: #fbf3e0;
  --rule: #e2cfa8;
  --desk: #e6d9bd;
  --envelope: #efddb6;
  --flap: #d8c08c;
  --stamp-color: var(--red);
  display: grid;
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}

.letter-demo:has(#paper-sakura:checked) {
  --paper: #fff6f3;
  --rule: #efc4be;
  --desk: #f3d3cf;
  --envelope: #f3c9c4;
  --flap: #e3a29a;
}

.letter-demo:has(#paper-ocean:checked) {
  --paper: #f5fafc;
  --rule: #bfd6e4;
  --desk: #d3e3ec;
  --envelope: #c9deea;
  --flap: #9dbfd6;
}

.letter-demo:has(#stamp-bird:checked) { --stamp-color: #8fbdb3; }
.letter-demo:has(#stamp-moon:checked) { --stamp-color: var(--navy); }

.letter-intro .lead {
  margin-top: 18px;
}

.choices {
  margin-top: 34px;
  display: grid;
  gap: 26px;
}

.choice {
  border: 0;
  padding: 0;
  min-width: 0;
}

.choice legend {
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.choice-row label {
  position: relative;
  cursor: pointer;
}

.choice-row input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-row .opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 10px;
  border-radius: 999px;
  background: var(--paper-white);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  transition: box-shadow 0.2s ease;
}

.choice-row input:checked + .opt {
  box-shadow: inset 0 0 0 2.5px var(--navy);
}

.choice-row input:focus-visible + .opt {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(30, 42, 74, 0.18);
}

.swatch--sepia { background: linear-gradient(#efddb6 50%, #fbf3e0 50%); }
.swatch--sakura { background: linear-gradient(#f3c9c4 50%, #fff6f3 50%); }
.swatch--ocean { background: linear-gradient(#c9deea 50%, #f5fafc 50%); }

.opt .stamp {
  width: 26px;
  height: auto;
}

.envelope-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1.5px dashed var(--line);
  max-width: 26em;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.envelope-note svg {
  flex: none;
  width: 72px;
  height: auto;
}

.env-body { fill: var(--envelope); transition: fill 0.4s ease; }
.env-flap {
  fill: none;
  stroke: var(--flap);
  stroke-width: 2;
  stroke-linejoin: round;
  transition: stroke 0.4s ease;
}
.env-stamp { fill: var(--stamp-color); transition: fill 0.4s ease; }

.desk {
  padding: clamp(18px, 3.4vw, 44px);
  border-radius: 28px;
  background: var(--desk);
  transition: background-color 0.4s ease;
}

.paper {
  --lh: 34px;
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--lh) * 1) clamp(20px, 4vw, 40px) calc(var(--lh) * 1.5);
  border-radius: 6px;
  background-color: var(--paper);
  color: var(--navy);
  font-family: var(--f-letter);
  font-size: 17px;
  line-height: var(--lh);
  transform: rotate(-0.6deg);
  transition: background-color 0.4s ease;
}

.paper-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: calc(var(--lh) * 3);
}

.paper-to {
  padding-top: var(--lh);
  font-weight: 600;
  font-size: 19px;
}

.postage {
  position: relative;
  flex: none;
  width: 124px;
  height: 84px;
}

.postage .stamp {
  position: absolute;
  top: 0;
  right: 0;
  width: 62px;
  height: auto;
  display: none;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 74, 0.12));
}

.letter-demo:has(#stamp-post:checked) .postage .stamp--post,
.letter-demo:has(#stamp-bird:checked) .postage .stamp--bird,
.letter-demo:has(#stamp-moon:checked) .postage .stamp--moon {
  display: block;
  animation: stick 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes stick {
  from { transform: translateY(-10px) rotate(6deg) scale(1.12); }
  to { transform: none; }
}

.postmark {
  position: absolute;
  top: 14px;
  left: 0;
  width: 78px;
  height: auto;
  transform: rotate(-11.5deg);
  opacity: 0.72;
}

.postmark circle,
.postmark line {
  fill: none;
  stroke: var(--navy);
}

.postmark text {
  fill: var(--navy);
  font-family: var(--f-ui);
  text-anchor: middle;
}

@media (max-width: 559px) {
  .paper-head {
    flex-direction: column-reverse;
  }

  .postage {
    align-self: flex-end;
  }

  .paper-to {
    padding-top: 0;
  }
}

.paper-body {
  background-image: linear-gradient(
    to bottom,
    transparent calc(var(--lh) - 1px),
    var(--rule) calc(var(--lh) - 1px)
  );
  background-size: 100% var(--lh);
  transition: background-image 0.4s ease;
}

.paper-body p + p {
  margin-top: var(--lh);
}

.paper-from {
  margin-top: var(--lh);
  text-align: right;
  font-weight: 600;
}

@media (min-width: 960px) {
  .letter-demo {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  }

  .letter-intro {
    position: sticky;
    top: 48px;
  }
}

/* ---- 手紙の旅（スクロールで時間が進む） ---- */
.journey {
  --scene-h: min(46svh, 92vw, 480px);
  position: relative;
}

.journey-stage {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 9vw, 110px) var(--gutter) calc(var(--scene-h) + var(--sheet-r) + 24px);
}

.journey-copy {
  position: relative;
  z-index: 3;
  max-width: 30em;
}

.track {
  display: none;
  align-items: center;
  gap: 10px;
  width: min(300px, 100%);
  margin-bottom: 26px;
}

.track svg {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-line {
  position: relative;
  flex: 1;
  height: 28px;
}

.track-line::before,
.track-fill {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  height: 2px;
}

.track-line::before {
  right: 0;
  background: repeating-linear-gradient(90deg, var(--on-sky) 0 5px, transparent 5px 9px);
  opacity: 0.45;
}

.track-fill {
  width: calc(var(--travel, 0) * 100%);
  background: var(--red);
}

.track-env {
  position: absolute;
  top: 1px;
  left: clamp(0px, calc(var(--travel, 0) * 100% - 17px), calc(100% - 34px));
  width: 34px;
  height: auto;
}

.caption + .caption {
  margin-top: 36px;
}

.caption p {
  margin-top: 14px;
  font-weight: 700;
  color: var(--on-sky-soft);
}

.journey-scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--sheet-r);
  height: var(--scene-h);
}

.journey-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.strip {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  aspect-ratio: 2400 / 360;
  overflow: visible;
  transform: translate3d(calc(50vw - var(--scene-h) * 0.9), 0, 0);
}

.route {
  fill: none;
  stroke: var(--on-sky);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 0.1 13;
  opacity: 0.42;
}

.mailbox-flag {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: rotate(90deg);
  transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.arrived-bubble {
  transform-box: fill-box;
  transform-origin: 100% 100%;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.journey.is-arrived .mailbox-flag {
  transform: none;
}

.journey.is-arrived .arrived-bubble {
  opacity: 1;
  transform: none;
}

/* スクロールに連動するとき（JS が有効で、動きを減らす設定でないとき） */
.journey--live {
  height: 360vh;
}

.journey--live .journey-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding-top: clamp(56px, 11svh, 120px);
  padding-bottom: 0;
}

.journey--live .track {
  display: flex;
}

.journey--live .captions {
  position: relative;
}

.journey--live .caption {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.journey--live .caption.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.journey--live .strip {
  will-change: transform;
}

@media (min-width: 900px) {
  .journey {
    --scene-h: min(58svh, 560px);
  }
}

/* ---- できること ---- */
.features-head {
  margin-bottom: clamp(28px, 4vw, 48px);
}

.features {
  display: grid;
}

.feature:last-child {
  padding-bottom: 0;
}

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 36px 0;
  border-top: 1.5px dashed var(--line);
}

.feature h3 {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.5;
}

.feature p {
  margin-top: 10px;
  max-width: 30em;
  color: var(--ink-soft);
}

.feature-art {
  width: 100%;
  max-width: 300px;
}

.feature-art svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.art-label {
  fill: var(--ink-soft);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 10px;
}

.ink {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.js .ink {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.js .is-inked .ink {
  stroke-dashoffset: 0;
  opacity: 1;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.5, 0, 0.3, 1), opacity 0.05s linear;
  transition-delay: calc(var(--i) * 0.22s);
}

.code-text {
  fill: var(--navy);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}

@media (min-width: 640px) {
  .feature {
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 36px;
  }
}

@media (min-width: 1000px) {
  .features-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr);
    gap: clamp(36px, 5vw, 72px);
    align-items: start;
  }

  .features-head {
    position: sticky;
    top: 48px;
    margin-bottom: 0;
  }

  .feature {
    grid-template-columns: 230px 1fr;
    gap: 40px;
  }
}

/* ---- 夜のシート（安心のために・しめくくり） ---- */
.sheet--night {
  background: #141c36;
  color: var(--paper-white);
}

.safety {
  display: grid;
  gap: 34px;
  margin-top: clamp(32px, 4vw, 52px);
}

.safety li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
}

.safety-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e2a4a;
  box-shadow: inset 0 0 0 1.5px #4a5788;
}

.safety-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--paper-white);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.safety h3 {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.6;
}

.safety p {
  margin-top: 6px;
  color: #b8bed3;
  max-width: 28em;
}

@media (min-width: 900px) {
  .safety {
    grid-template-columns: repeat(3, 1fr);
    gap: 44px;
  }

  .safety li {
    grid-template-columns: 1fr;
    gap: 16px;
    align-content: start;
  }
}

/* しめくくり（深夜の風景） */
.closing {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--sheet-r) * -1);
  border-radius: var(--sheet-r) var(--sheet-r) 0 0;
  overflow: hidden;
}

.closing-inner {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter) 0;
}

.closing-copy p {
  margin-top: 18px;
  max-width: 26em;
  font-weight: 700;
  color: var(--on-sky-soft);
}

.contact {
  margin-top: 26px;
  font-size: 15px;
}

.contact a {
  font-weight: 700;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.closing-scene {
  width: 100%;
  height: min(48svh, 92vw, 440px);
  margin-top: 24px;
}

.closing-scene .scene {
  width: 100%;
  height: 100%;
}

@media (min-width: 900px) {
  .closing-inner {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .closing-copy {
    padding-bottom: clamp(64px, 9vw, 120px);
  }

  .closing-scene {
    margin-top: 0;
  }
}

.site-footer {
  position: relative;
  z-index: 2;
  background: #0a0f20;
  color: #aab1c8;
  font-size: 14px;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px var(--gutter) 34px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}

.site-footer a {
  text-decoration: none;
  font-weight: 700;
  color: #f1ebdd;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---- 利用規約・プライバシーポリシー ---- */
.legal-page {
  background: var(--cream);
}

.legal-header {
  color: var(--navy);
  padding-bottom: 8px;
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) var(--gutter) clamp(64px, 9vw, 110px);
}

.legal h1 {
  font-size: clamp(30px, 4.4vw, 44px);
}

.legal-updated {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

.legal section {
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1.5px dashed var(--line);
}

.legal h2 {
  font-size: 19px;
  font-weight: 900;
  line-height: 1.6;
}

.legal section p {
  margin-top: 10px;
  white-space: pre-line;
}

.legal-back {
  display: inline-block;
  margin-top: 44px;
  font-weight: 700;
  text-underline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
