/* アプリのサイトの見た目。参考：a24.raviklaassens.com の作品のページ（/production/…）。perrii.app のトップと、紙の背景・字を揃えている。
   追星（oiboshi/src/style.css）と Orto（orto/public/style.css）は、先頭の --accent（アプリの色）だけが違う。直すときは両方。
   トップ（.page-index）：題名と情報の表 → キービジュアル → 説明 → 機能 → … → 次のアプリ、と縦に読む。
   ほかのページ（規約など）：上にメニュー、真ん中に本文（.prose）、下に規約へのリンク。 */
:root {
  color-scheme: light;
  --accent: #765767;      /* アプリの色 */
  --bg: #f2f2f0;
  --bg-2: #dcd9d4;        /* 説明から下の、少し濃い紙 */
  --text: #141414;
  --muted: #7a7a76;
  --line: #141414;
  --line-soft: #b9b6b0;
  --font: "Inter Tight", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --serif: "Instrument Serif", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --gutter: clamp(12px, 2vw, 24px);
  --prose-width: 720px;
  /* 紙の質感（細かいノイズ） */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg) var(--grain);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 小さい見出し（YEAR・DEVELOPED BY など） */
.label { font-size: 0.55rem; letter-spacing: 0.2em; text-transform: uppercase; font-family: var(--serif); }

/* メニュー（上の真ん中に、ずっと出す） */
.menu {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 24px;
  padding: 10px var(--gutter); font-size: 0.75rem; font-weight: 500;
  mix-blend-mode: difference; color: #fff; /* 写真の上でも読めるように */
}
.menu a { text-decoration: none; }
.menu a:hover { opacity: 0.5; }
.menu .brand { font-family: var(--serif); font-size: 1.15rem; line-height: 1; }

/* 下：規約へのリンク */
.site-footer { padding: 32px var(--gutter); font-size: 0.75rem; color: var(--muted); text-align: center; border-top: 1px solid var(--line-soft); }
.page-index .site-footer { background: var(--bg-2) var(--grain); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 8px 0 0; }

/* 規約・お知らせなどの本文 */
.prose { max-width: var(--prose-width); margin: 0 auto; padding: 24px var(--gutter) 80px; overflow-wrap: anywhere; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; margin: 24px 0 24px; }
.prose h2 { font-size: 1.1rem; margin-top: 2.4em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1rem; margin-top: 1.6em; }
.prose a { color: var(--accent); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 1em 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line-soft); padding: 10px 8px; text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 500; }
.prose hr { border: none; border-top: 1px solid var(--line-soft); margin: 2em 0; }
.prose .date { color: var(--muted); margin: 0; }
.prose .todo { background: #fff3cd; color: #7a5b00; padding: 0 4px; border-radius: 3px; font-weight: bold; }

.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.news-list time { color: var(--muted); flex: none; font-size: 0.85rem; padding-top: 2px; }
.news-list a { color: inherit; text-decoration: none; }
.news-list a:hover { opacity: 0.6; }

/* ---------- トップ ---------- */
.page-index main { overflow-x: clip; }

/* 1. 題名と情報 */
.hero { position: relative; padding: 24px 0 0; text-align: center; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; text-transform: uppercase;
  font-size: clamp(3.6rem, 9vw, 7.5rem); line-height: 0.85; letter-spacing: -0.01em; margin: 0 0 12px;
}
.hero h1 small { display: block; font-size: 0.2em; letter-spacing: 0.4em; margin-top: 12px; }
.credits { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; padding: 6px var(--gutter); font-size: 0.75rem; border-top: 1px solid var(--line); }
.credits .label { margin-left: 8px; }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 2px var(--gutter); border-bottom: 1px solid var(--line); font-size: 0.75rem; }
.facts dt { padding-top: 3px; }
.facts dd { margin: 0; }

/* 四隅の + */
.cross { position: absolute; width: 11px; height: 11px; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--text); }
.cross::before { left: 5px; top: 0; width: 1px; height: 11px; }
.cross::after { top: 5px; left: 0; height: 1px; width: 11px; }

.stage { position: relative; height: clamp(420px, 62vh, 620px); perspective: 1400px; display: grid; place-items: center; }
.stage .cross:nth-of-type(1) { left: var(--gutter); top: 24px; }
.stage .cross:nth-of-type(2) { right: var(--gutter); top: 24px; }
.stage .cross:nth-of-type(3) { left: var(--gutter); bottom: 24px; }
.stage .cross:nth-of-type(4) { right: var(--gutter); bottom: 24px; }
.stage .icon {
  width: clamp(160px, 24vw, 300px); border-radius: 22%;
  transform: rotateX(34deg) rotateY(-20deg) rotateZ(-8deg); /* JS（production.js）が、スクロールに合わせて起こす */
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2), 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* 二重線の大きなボタン */
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0 var(--gutter) 48px; }
.button {
  display: inline-flex; flex-direction: column; align-items: center;
  font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1; text-transform: uppercase; text-decoration: none;
  padding: 8px 2px 6px; border-top: 4px double var(--line); border-bottom: 4px double var(--line);
}
.button small { font-family: var(--font); font-size: 0.6rem; letter-spacing: 0.15em; margin-top: 4px; color: var(--muted); }
a.button:hover { opacity: 0.6; }

/* 2. キービジュアルとキャッチ */
.visual { position: relative; height: min(110vh, 1000px); background: #222 center / cover no-repeat; color: #fff; overflow: hidden; }
.visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.visual .words { position: absolute; inset: 0; }
.visual .words span {
  position: absolute; font-family: var(--serif); text-transform: uppercase; white-space: nowrap;
  font-size: clamp(2.4rem, 7vw, 6.5rem); line-height: 1; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}
.visual .words span:nth-child(1) { left: 58%; top: 14%; }
.visual .words span:nth-child(2) { left: 10%; top: 38%; }
.visual .words span:nth-child(3) { left: 34%; top: 62%; }
.visual .rule { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255, 255, 255, 0.5); }
.visual .rule:nth-of-type(1) { top: 55%; }
.visual .rule:nth-of-type(2) { top: 81%; }
.visual .button { position: absolute; left: 52%; top: calc(55% + 8px); color: #fff; border-color: #fff; font-size: clamp(1rem, 1.8vw, 1.4rem); }

/* 3. 説明と、対応しているもの */
.story { background: var(--bg-2) var(--grain); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding: 16px var(--gutter) 120px; }
.story .synopsis { font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.45; margin: 0; max-width: 24em; }
.story ul { list-style: none; margin: 0; padding: 0; text-align: right; }
.story li { font-size: 0.85rem; text-transform: uppercase; line-height: 1.7; }
.story li .label { margin-right: 8px; }

/* 4. 機能（傾けた画面と説明が、交互に並ぶ） */
.block { background: var(--bg-2) var(--grain); border-top: 1px solid var(--line); padding: 0 var(--gutter) 96px; }
.block > h2 {
  font-family: var(--serif); font-weight: 400; text-transform: uppercase; text-align: center;
  font-size: clamp(3rem, 8vw, 6.5rem); line-height: 1; margin: 0; padding: 56px 0 40px;
}
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; border-top: 1px solid var(--line-soft); padding: 48px 0; perspective: 1400px; }
.feature:nth-of-type(even) .shot { order: 2; }
.feature .shot { justify-self: center; width: clamp(150px, 18vw, 230px); border-radius: 12% / 6%; border: 6px solid #141414; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18); transform: rotateX(34deg) rotateY(-20deg) rotateZ(-8deg); }
.feature h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.1; margin: 8px 0 16px; }
.feature p { margin: 0; max-width: 30em; }

.block .text { max-width: var(--prose-width); margin: 0 auto; text-align: center; }
.block .text p a, .block .text a.inline { color: var(--accent); }
.news .news-list { max-width: var(--prose-width); margin: 0 auto; }
.news .more { text-align: center; }
.legal ul { list-style: none; margin: 0 auto; padding: 0; max-width: var(--prose-width); border-top: 1px solid var(--line-soft); }
.legal li a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.legal li a::after { content: "→"; color: var(--muted); }
.legal li a:hover { color: var(--accent); }
.page-index .site-footer nav { display: none; } /* トップでは、規約の一覧を Next App の上に出している */
.mail { font-family: var(--serif); font-size: clamp(1.8rem, 6vw, 4rem); line-height: 1.1; margin: 24px 0; overflow-wrap: anywhere; }
.mail a { text-decoration: none; border-bottom: 1px solid currentColor; }
.mail a:hover { opacity: 0.6; }

/* 5. 次のアプリ */
.next { display: block; position: relative; background: var(--bg-2) var(--grain); text-decoration: none; overflow: hidden; perspective: 1400px; padding-bottom: 0; }
.next .row { border-top: 1px solid var(--line); height: clamp(80px, 14vh, 150px); display: flex; align-items: center; justify-content: center; }
.next .row:last-of-type { border-bottom: 1px solid var(--line); }
.next .title { font-family: var(--serif); font-size: clamp(3rem, 9vw, 7rem); text-transform: uppercase; line-height: 1; }
.next .icon {
  position: absolute; left: 50%; bottom: -28%; width: clamp(180px, 26vw, 340px); margin-left: calc(clamp(180px, 26vw, 340px) / -2);
  border-radius: 22%; box-shadow: 0 40px 80px rgba(0, 0, 0, 0.25);
  transform: rotateX(34deg) rotateY(-20deg) rotateZ(-8deg); transition: bottom 0.5s;
}
.next:hover .icon { bottom: -18%; }

/* 404 */
.notfound { text-align: center; padding: 15vh var(--gutter); }
.notfound h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(6rem, 24vw, 16rem); line-height: 0.85; margin: 0; }

@media (max-width: 720px) {
  .story, .feature { grid-template-columns: 1fr; gap: 24px; }
  .story ul { text-align: left; }
  .feature:nth-of-type(even) .shot { order: 0; }
  .visual { height: 80vh; }
  .visual .words span:nth-child(1) { left: auto; right: 6%; }
  .visual .words span:nth-child(2) { left: 6%; }
  .visual .words span:nth-child(3) { left: auto; right: 6%; }
  .visual .button { left: var(--gutter); }
  .news-list li { flex-direction: column; gap: 0; }
}
