/* ============================================================
   portal.css — shin.apps 大元ポータル専用 (完全スタンドアロン)

   ポータルはジャンル中立のモノトーン (白×黒) デザイン。
   ダーク×ネオンの shared.css には依存しない。
   配下の各シリーズ (re/ 以下) はそれぞれ固有の世界観を持つ。
   ============================================================ */

:root {
    /* ブラウザUI (スクロールバー/フォーム部品) をライト側に合わせる */
    color-scheme: light;

    --bg: #FAFAF8;
    --ink: #101010;
    --ink-sub: #55554F;
    --ink-faint: #9A9A94;
    --line: #E3E3DE;
    --line-strong: #101010;
    --paper: #FFFFFF;

    --font-jp: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
    --font-display: "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", monospace;

    --max-w: 1120px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* fixed nav の下にアンカー先が潜り込まないようにオフセット */
[id] {
    scroll-margin-top: 90px;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-jp);
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

::selection {
    background: var(--ink);
    color: var(--bg);
}

/* ---------- 日本語の折り返し制御 ----------
   見出しは balance で行長を均し、本文は pretty で泣き別れを抑制する
   (対応ブラウザのみ適用)。単語単位で切りたくない箇所は .no-break。 */

h1, h2, h3, h4, summary {
    text-wrap: balance;
}

p, li, dd, figcaption {
    text-wrap: pretty;
}

/* 文節単位で改行する (Chromium系のみ / lang="ja" が前提)。
   非対応ブラウザは従来どおりの文字単位折返しにフォールバック */
body {
    word-break: auto-phrase;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 110px 0;
}

/* ---------- ナビゲーション ---------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
    background: rgba(250, 250, 248, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.nav-brand .thin {
    color: var(--ink-faint);
    font-weight: 500;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-sub);
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 6px;
}

@media (max-width: 720px) {
    .nav-links {
        gap: 20px;
    }
    .nav-links .hide-sp {
        display: none;
    }
}

/* ---------- ラベル / 見出し ---------- */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-sub);
    margin-bottom: 26px;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--ink);
}

.sec-head {
    margin-bottom: 20px;
}

.sec-head h2 {
    font-size: clamp(30px, 4.2vw, 46px);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.sec-lead {
    color: var(--ink-sub);
    font-size: 15px;
    max-width: 600px;
    margin-bottom: 64px;
}

/* ---------- Hero ---------- */

.hero {
    padding-top: 200px;
    padding-bottom: 90px;
}

.hero h1 {
    font-size: clamp(33px, 7.5vw, 96px);
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: 0.01em;
    margin-bottom: 12px;
}

.hero h1 .outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
}

@media (max-width: 640px) {
    .hero h1 .outline {
        -webkit-text-stroke: 1.5px var(--ink);
    }
}

/* サブコピー: モバイル幅(375px)でも改行させず1行に収める */
.hero-tagline {
    font-size: clamp(15px, 4.8vw, 44px);
    color: var(--ink-sub);
    margin-bottom: 40px;
}

.hero .lead {
    font-size: clamp(15px, 1.8vw, 17px);
    color: var(--ink-sub);
    max-width: 580px;
    margin-bottom: 56px;
}

/* 汎用: 単語・フレーズ単位で改行させたくない箇所に使う */
.no-break {
    white-space: nowrap;
}

.hero-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--line-strong);
    padding-top: 18px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ---------- ボタン ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 34px;
    border-radius: 999px;
    font-family: var(--font-jp);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.btn-ink {
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
}

.btn-ink:hover {
    background: transparent;
    color: var(--ink);
}

.btn-line {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
}

.btn-line:hover {
    background: var(--ink);
    color: var(--bg);
}

/* ---------- マーキー ---------- */

.marquee {
    overflow: hidden;
    background: var(--ink);
    color: var(--bg);
    padding: 15px 0;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 38s linear infinite;
}

.marquee-track span {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.3em;
    white-space: nowrap;
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

/* ---------- ラインナップ (スイッチボード) ----------

   行そのものを「操作盤のスイッチ」として扱う。
   ホバー/フォーカスで (1) 面が反転し (2) タイトルが少し右にスライドし
   (3) 右端のオーブが拡大回転する、という3つの動きを同時に起こす。
   グリッドの列幅は常に固定 (--row-cols を持たない) — 説明文の折り返しが
   ホバーで動かないようにするため、あえて列幅そのものはアニメーションしない。
   状態はカスタムプロパティ (--row-*) にまとめ、通常時とホバー時で
   変数だけを差し替える。transition は実プロパティ側にかけてある。   */

.switch-board {
    list-style: none;
    border: 2px solid var(--line-strong);
}

.switch {
    /* 通常時の状態 */
    --row-bg: var(--bg);
    --row-ink: var(--ink);
    --row-sub: var(--ink-sub);
    --row-faint: var(--ink-faint);
    --orb-tf: none;
    --orb-glow: 0 0 22px rgba(28, 229, 255, 0.16);
    --ghost-filter: grayscale(1);
    --arrow-tf: none;
    --h3-tf: none;

    display: grid;
    /* 列幅は固定 (ホバーで動かさない)。可変させたい場合はここではなく
       各カラム内の要素の transform で表現すること */
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr) 150px;
    gap: 28px;
    align-items: center;
    min-height: 208px;
    padding: 28px 26px;
    background: var(--row-bg);
    color: var(--row-ink);
    border-bottom: 1px solid var(--line-strong);
    transition: background 0.25s ease, color 0.25s ease;
}

.switch-board > li:last-child .switch {
    border-bottom: 0;
}

.switch > * {
    min-width: 0;
}

/* --- 状態: ホバー (ポインタ端末のみ) / キーボードフォーカス --- */

.switch:focus-visible {
    --row-bg: var(--ink);
    --row-ink: var(--bg);
    --row-sub: rgba(250, 250, 248, 0.66);
    --row-faint: rgba(250, 250, 248, 0.52);
    --orb-tf: scale(1.1) rotate(-8deg);
    --orb-glow: 0 0 38px rgba(28, 229, 255, 0.32);
    --arrow-tf: translateX(8px);
    --h3-tf: translateX(8px);
    outline: 2px solid var(--bg);
    outline-offset: -7px;
}

@media (hover: hover) and (pointer: fine) {
    .switch:hover {
        --row-bg: var(--ink);
        --row-ink: var(--bg);
        --row-sub: rgba(250, 250, 248, 0.66);
        --row-faint: rgba(250, 250, 248, 0.52);
        --orb-tf: scale(1.1) rotate(-8deg);
        --orb-glow: 0 0 38px rgba(28, 229, 255, 0.32);
        --arrow-tf: translateX(8px);
        --h3-tf: translateX(8px);
    }
}

/* --- 行の中身 --- */

.switch h3 {
    /* タイトルは英語がメインになったため、日本語向けの詰め (-0.01em) から
       「Lineup」見出し (sec-head h2, letter-spacing: 0.02em) と同じトーンへ調整 */
    font-size: clamp(23px, 3.2vw, 42px);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: 0.02em;
    transform: var(--h3-tf);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.switch h3 .tag {
    /* タグは日本語がメインになったため、英字向けのmono/uppercase/広いletter-spacingをやめ
       日本語として自然な字間に調整 */
    display: block;
    margin-top: 14px;
    font-family: var(--font-jp);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.06em;
    color: var(--row-faint);
    transition: color 0.25s ease;
}

.switch-body p {
    font-size: 14px;
    line-height: 1.85;
    color: var(--row-sub);
    max-width: 34rem;
    transition: color 0.25s ease;
}

.badge {
    display: inline-block;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 7px 14px;
    white-space: nowrap;
}

.badge.soon {
    color: var(--row-faint);
    border-style: dashed;
    transition: color 0.25s ease;
}

.switch-side {
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 18px;
}

/* オーブ: 右端の円。ホバーで拡大しながら少し傾く */
.orb {
    width: 112px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 34px;
    line-height: 1;
    transform: var(--orb-tf);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
        box-shadow 0.35s ease;
}

/* Re:シリーズのオーブ: ダークネイビー地にアプリアイコン + シアンの発光 */
.re-orb {
    position: relative;
    background: #0B1220;
    box-shadow: var(--orb-glow);
}

.re-orb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.re-orb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(28, 229, 255, 0.45);
}

/* 準備中ジャンルのオーブ: 破線の円にモノトーンの絵文字 */
.ghost-orb {
    border: 1px dashed currentColor;
    color: var(--row-faint);
    filter: grayscale(1);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
        color 0.25s ease;
}

.arrow {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
    transform: var(--arrow-tf);
    transition: transform 0.25s ease;
}

/* 準備中の行 (リンクなし) */
.switch.is-soon {
    cursor: default;
}

/* --- スイッチボード上のカーソルリング (JSで座標更新) --- */

.switch-cursor {
    position: fixed;
    z-index: 90;
    left: var(--sw-x, -200px);
    top: var(--sw-y, -200px);
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border: 1px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: difference;
    opacity: 0;
    transform: scale(0.35);
    transition: opacity 0.18s ease,
        transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.switch-cursor.on {
    opacity: 1;
    transform: scale(1);
}

@media (pointer: coarse) {
    .switch-cursor {
        display: none;
    }
}

/* --- タブレット / モバイル --- */

@media (max-width: 900px) {
    .switch {
        grid-template-columns: minmax(0, 1fr) 104px;
        gap: 20px;
        min-height: 0;
        align-items: start;
        padding: 26px 18px;
    }
    .switch h3 {
        grid-column: 1;
        grid-row: 1;
    }
    .switch-side {
        grid-column: 2;
        grid-row: 1;
    }
    .switch-body {
        grid-column: 1 / 3;
        grid-row: 2;
        margin-top: -6px;
    }
    .orb {
        width: 84px;
        font-size: 26px;
    }
    .arrow {
        font-size: 18px;
    }
}

@media (max-width: 560px) {
    .switch-cursor {
        display: none;
    }
    .switch {
        grid-template-columns: minmax(0, 1fr) 62px;
        gap: 12px;
        padding: 22px 14px;
    }
    .switch h3 .tag {
        margin-top: 10px;
        font-size: 10.5px;
        letter-spacing: 0.05em;
    }
    .switch-body p {
        font-size: 13.5px;
    }
    .badge {
        margin-top: 14px;
        font-size: 9.5px;
        letter-spacing: 0.12em;
        padding: 6px 11px;
        white-space: normal;
    }
    .switch-side {
        gap: 12px;
    }
    .orb {
        width: 62px;
        font-size: 20px;
    }
}

/* ---------- Philosophy ---------- */

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 44px;
    margin-top: 64px;
}

.philosophy-grid .col {
    border-top: 1px solid var(--line-strong);
    padding-top: 26px;
}

.philosophy-grid h3 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.5;
}

.philosophy-grid p {
    font-size: 14px;
    color: var(--ink-sub);
}

/* ---------- Contact ---------- */

.contact {
    border-top: 1px solid var(--line);
}

.contact h2 {
    font-size: clamp(34px, 6vw, 68px);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 28px;
}

.contact p {
    color: var(--ink-sub);
    font-size: 15px;
    max-width: 560px;
    margin-bottom: 44px;
}

/* ---------- フッター ---------- */

.footer {
    border-top: 1px solid var(--line-strong);
    padding: 44px 0 60px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer .brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
}

.footer .brand .thin {
    color: var(--ink-faint);
    font-weight: 500;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.footer-links a {
    color: var(--ink-sub);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 5px;
}

.footer .copy {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
}

/* ---------- スクロールリビール ---------- */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1),
        transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .marquee-track {
        animation: none;
    }
    .switch,
    .switch h3,
    .switch h3 .tag,
    .switch-body p,
    .badge.soon,
    .orb,
    .ghost-orb,
    .arrow,
    .switch-cursor {
        transition: none;
    }
    .switch-cursor {
        display: none;
    }
}
