/* ========================================
   Raim Technologies
   Direction: Precise, technical, engineered
   ======================================== */

:root {
    /* Ink — text hierarchy */
    --ink: #111827;
    --ink-2: #374151;
    --ink-3: #6b7280;
    --ink-4: #9ca3af;

    /* Ground — surfaces */
    --ground: #ffffff;
    --ground-alt: #f8f9fb;

    /* Rule — borders */
    --rule: rgba(0, 0, 0, 0.08);
    --rule-strong: rgba(0, 0, 0, 0.14);

    /* Signal — the green. Used with intent. */
    --signal: #1dbd4d;
    --signal-hover: #13a13e;
    /* 白背景上の文字・ボタン用の深い緑。ロゴの緑(#1dbd4d, 色相138°)と
       同一色相・同彩度のまま暗くした色(白文字と4.6:1、AA通過) */
    --signal-deep: #128735;
    --signal-deep-hover: #117930;
    --signal-surface: rgba(29, 189, 77, 0.06);

    /* Typography */
    --font-body: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Noto Sans JP', monospace;

    /* Spacing — 8px base */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 80px;

    /* Layout */
    --container-width: 1200px;

    /* Motion */
    --ease: 0.2s ease;
}

/* ========================================
   Splash Screen
   ======================================== */
#splash {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: var(--ground);
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: opacity;
    animation: splash-exit 0.35s cubic-bezier(0.4, 0, 0.2, 1) 1.6s forwards;
}

.splash-logo {
    height: 72px;
    width: auto;
    will-change: clip-path, transform, opacity;
    animation: splash-anim 1.4s ease 0.1s both;
}

@keyframes splash-anim {
    0% {
        opacity: 0;
        clip-path: inset(0 72% 0 0);
        transform: translateX(36%) scale(0.92);
        animation-timing-function: ease-out;
    }
    15% {
        opacity: 1;
        clip-path: inset(0 72% 0 0);
        transform: translateX(36%) scale(1);
        animation-timing-function: ease;
    }
    35% {
        opacity: 1;
        clip-path: inset(0 72% 0 0);
        transform: translateX(36%) scale(1);
        animation-timing-function: cubic-bezier(.77, 0, .175, 1);
    }
    78% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: translateX(0) scale(1);
        animation-timing-function: ease;
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: translateX(0) scale(1);
    }
}

@keyframes splash-exit {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Splash is shown once per session; .no-splash is set in <head> on repeat views */
.no-splash #splash {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    #splash {
        display: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--ground);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--ease);
}

ul, ol { list-style: none; }

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ========================================
   Container
   ======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* ========================================
   Skip Link
   ======================================== */
.skip-link {
    position: fixed;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 10003;
    padding: 10px 16px;
    background: var(--ink);
    color: #ffffff;
    font-size: 0.85rem;
    transform: translateY(-250%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ========================================
   Floating Header (.gh)
   ======================================== */
.gh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    pointer-events: none;
}

/* Scrolled: translucent backdrop so content never collides with the nav */
.gh::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gh.gh--scrolled::before {
    opacity: 1;
}

/* ダークセクション上では下地の紺(#111827)より明確に暗くして
   輝度差で境界を立たせる */
.gh.gh--light::before {
    background: rgba(4, 7, 15, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.gh.gnav-open::before {
    opacity: 0;
}

.gh-logo,
.gh-nav,
.gh-menu {
    position: relative;
}

.gh-logo,
.gh-nav,
.gh-menu {
    pointer-events: auto;
}

.gh-logo {
    display: flex;
    align-items: center;
    position: relative;
}

.gh-logo-img {
    height: 36px;
    width: auto;
    transition: opacity 0.3s cubic-bezier(.77, 0, .175, 1);
}

.gh-logo-img--icon {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 32px;
    opacity: 0;
}

.gh.gnav-open .gh-logo-img--default,
.gh.gh--logo-hiding .gh-logo-img--default {
    opacity: 0;
}

.gh.gnav-open .gh-logo-img--icon {
    opacity: 1;
}

.gh.gh--logo-hiding .gh-logo-img--icon {
    opacity: 0;
}

/* Inline nav (desktop) */
.gh-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.gh-nav-link {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    padding: var(--space-2) 0;
    transition: color 0.3s cubic-bezier(.77, 0, .175, 1);
}

.gh-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.3s cubic-bezier(.77, 0, .175, 1);
}

.gh-nav-link:hover::after,
.gh-nav-link[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.gh.gh--light .gh-nav-link {
    color: #ffffff;
}

/* Menu button */
.gh-menu {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    color: var(--ink);
    transition: color 0.3s cubic-bezier(.77, 0, .175, 1);
}

.gh.gnav-open .gh-menu,
.gh.gh--light .gh-menu {
    color: #ffffff;
}

/* Light mode header on dark backgrounds — icon only */
.gh.gh--light .gh-logo-img--default {
    opacity: 0;
}

.gh.gh--light .gh-logo-img--icon {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.gh-menu-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gh-menu-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 24px;
}

.gh-menu-lines span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 0.3s cubic-bezier(.77, 0, .175, 1), opacity 0.3s cubic-bezier(.77, 0, .175, 1);
    transform-origin: center;
}

/* X state */
.gh.gnav-open .gh-menu-lines span:first-child {
    transform: translateY(4px) rotate(45deg);
}

.gh.gnav-open .gh-menu-lines span:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

/* Hamburger is mobile-only; the inline nav is hidden at mobile widths instead */
@media (min-width: 769px) {
    .gh-menu {
        display: none;
    }
}

/* ========================================
   Full-screen Nav Overlay (.gnav)
   ======================================== */
.gnav {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    /* visibility: 閉じている間はTabキーでリンクに到達させない */
    visibility: hidden;
    transition: opacity 0s 0.55s, visibility 0s 0.55s;
}

.gnav.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0s 0s, visibility 0s 0s;
}

.gnav.close {
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 0s 0.55s, visibility 0s 0.55s;
}

/* Background wipe */
.gnav-bg {
    position: absolute;
    inset: 0;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.5s cubic-bezier(1, 0, 0, 1);
}

.gnav.open .gnav-bg {
    transform: scaleX(1);
}

.gnav.close .gnav-bg {
    transform: scaleX(0);
    transform-origin: left center;
}

/* Inner layout */
.gnav-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: var(--space-9) var(--space-8);
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Links */
.gnav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.gnav-link {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-4) var(--space-5);
    color: #ffffff;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease, background 0.3s ease;
}

.gnav.open .gnav-link {
    transform: translateY(0);
    opacity: 1;
}

.gnav.open .gnav-link:nth-child(1) { transition-delay: 0.15s, 0.15s, 0s; }
.gnav.open .gnav-link:nth-child(2) { transition-delay: 0.18s, 0.18s, 0s; }
.gnav.open .gnav-link:nth-child(3) { transition-delay: 0.21s, 0.21s, 0s; }
.gnav.open .gnav-link:nth-child(4) { transition-delay: 0.24s, 0.24s, 0s; }

.gnav.close .gnav-link {
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hover: left signal line + shift */
.gnav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--signal);
    transform: scaleY(0);
    transform-origin: bottom center;
    transition: transform 0.3s cubic-bezier(.77, 0, .175, 1);
}

.gnav-link:hover::before {
    transform: scaleY(1);
    transform-origin: top center;
}

/* Current page indicator */
.gnav-link[aria-current="page"]::before {
    transform: scaleY(1);
}

.gnav-link[aria-current="page"] .gnav-link-index {
    opacity: 1;
}

.gnav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(0) translateX(8px);
}

.gnav-link-index {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--signal);
    opacity: 0.5;
    min-width: 2em;
}

.gnav-link-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gnav-link-en {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
    margin-left: auto;
}

/* Contact info */
.gnav-info {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

.gnav.open .gnav-info {
    opacity: 1;
    transform: translateY(0);
}

.gnav.close .gnav-info {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gnav-info p {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.8;
}

.gnav-info a:hover {
    color: #ffffff;
}

/* ========================================
   Hero
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--ground);
}

.hero-bg {
    display: block;
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-grid { display: none; }
.hero-bg::before { display: none; }

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-7);
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-visual {
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.hero-visual img {
    width: min(560px, 100%);
    height: auto;
}

.hero-title {
    margin-bottom: var(--space-5);
}

.hero-title-sub {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--signal-deep);
    letter-spacing: 0.15em;
    margin-bottom: var(--space-4);
    text-transform: uppercase;
}

.hero-title-sub::before {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--signal);
    flex-shrink: 0;
}

.hero-title-main {
    display: block;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.text-accent {
    color: var(--signal-deep);
}

.hero-text {
    font-size: 1rem;
    color: var(--ink-2);
    margin-bottom: var(--space-6);
    max-width: 520px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--ease);
}

.btn-primary {
    background: var(--signal-deep);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--signal-deep-hover);
}

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

.btn-outline:hover {
    border-color: var(--ink-3);
    color: var(--ink);
}

.btn-large {
    padding: 14px 36px;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

/* ========================================
   Sections
   ======================================== */
section {
    padding: var(--space-9) 0;
}

.section-header {
    margin-bottom: var(--space-7);
}

.section-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ink-4);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.section-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ========================================
   Features
   ======================================== */
.features {
    background: var(--ground-alt);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.feature-card {
    background: var(--ground);
    padding: var(--space-6);
    border: 1px solid var(--rule);
    transition: border-color var(--ease);
}

.feature-card:hover {
    border-color: var(--rule-strong);
    box-shadow: inset 2px 0 0 var(--signal);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    background: none;
    border-radius: 0;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--ink-4);
    stroke-width: 1.5;
    transition: stroke var(--ease);
}

.feature-card:hover .feature-icon svg {
    stroke: var(--signal-deep);
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.feature-text {
    font-size: 0.9rem;
    color: var(--ink-2);
    line-height: 1.7;
}

/* ========================================
   Services Preview
   ======================================== */
.services-preview {
    background: var(--ground);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.service-card {
    position: relative;
    padding: var(--space-6);
    background: var(--ground);
    border: 1px solid var(--rule);
    transition: border-color var(--ease);
}

.service-card:hover {
    border-color: var(--rule-strong);
    box-shadow: inset 2px 0 0 var(--signal);
}

.service-number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--signal);
    opacity: 0.25;
    line-height: 1;
    margin-bottom: var(--space-5);
}

.service-number::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--signal);
    opacity: 0.5;
    vertical-align: middle;
    margin-left: var(--space-3);
}

.service-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.service-text {
    font-size: 0.9rem;
    color: var(--ink-2);
    margin-bottom: var(--space-5);
    line-height: 1.7;
}

.service-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--ink-3);
    transition: color var(--ease);
    letter-spacing: 0.02em;
}

.service-link:hover {
    color: var(--signal-deep);
}

/* リンクの当たり判定をカード全体に広げる */
.service-link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.service-card:hover .service-link {
    color: var(--signal-deep);
}

/* ========================================
   CTA
   ======================================== */
.cta {
    background: var(--ground-alt);
    padding: var(--space-9) 0;
    border-top: 1px solid var(--rule);
}

.cta-content {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.cta-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.cta-text {
    color: var(--ink-2);
    font-size: 0.95rem;
    margin-bottom: var(--space-6);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--ground);
    padding: var(--space-7) 0 var(--space-5);
    border-top: 1px solid var(--rule);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
}

.footer-logo {
    display: inline-block;
    margin-bottom: var(--space-4);
}

.footer-logo .logo-img {
    height: 32px;
    width: auto;
}

.footer-address {
    font-size: 0.85rem;
    color: var(--ink-3);
    line-height: 1.8;
}

.footer-nav ul {
    display: flex;
    gap: var(--space-6);
}

.footer-nav a {
    font-size: 0.85rem;
    color: var(--ink-3);
}

.footer-nav a:hover {
    color: var(--ink);
}

.footer-bottom {
    padding-top: var(--space-5);
    border-top: 1px solid var(--rule);
}

.copyright {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-4);
    text-align: center;
    letter-spacing: 0.02em;
}

/* ========================================
   Page Hero (subpages)
   ======================================== */
.page-hero {
    position: relative;
    padding: 100px 0 var(--space-8);
    background: var(--ground-alt);
    border-bottom: 1px solid var(--rule);
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.page-hero-content {
    position: relative;
    max-width: 600px;
}

.page-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ink-4);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ========================================
   About — Shared sv-section components
   ======================================== */

/* Statement (philosophy) */
.sv-statement {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-5);
}

/* Visual block (logo in philosophy) */
.sv-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sv-visual-img {
    width: 120px;
    height: auto;
    opacity: 0.12;
}

/* Message (CEO) body */
.sv-body--message {
    grid-template-columns: 180px 1fr;
    gap: var(--space-7);
    align-items: start;
}

.sv-ceo-photo {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sv-message-text p {
    font-size: 0.95rem;
    line-height: 2;
    margin-bottom: var(--space-5);
}

.sv-section[data-theme="light"] .sv-message-text p {
    color: var(--ink-2);
}

.sv-section[data-theme="dark"] .sv-message-text p {
    color: rgba(255, 255, 255, 0.85);
}

.sv-signature {
    margin-top: var(--space-6);
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.sv-signature-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
}

.sv-signature-name {
    font-size: 1.15rem;
    font-weight: 600;
}

.sv-signature-en {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

/* Single-column body (company info) */
.sv-body--single {
    grid-template-columns: 1fr;
}

/* Info table */
.sv-info-table {
    max-width: 800px;
}

.sv-info-list {
    border-top: 1px solid var(--rule);
}

.sv-info-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    border-bottom: 1px solid var(--rule);
}

.sv-info-row dt {
    padding: var(--space-5) var(--space-4);
    background: var(--ground-alt);
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--ink-3);
    letter-spacing: 0.02em;
}

.sv-info-row dd {
    padding: var(--space-5) var(--space-4);
    font-size: 0.95rem;
    color: var(--ink-2);
}

.sv-info-en {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-4);
    margin-top: var(--space-1);
}

/* ========================================
   Contact — sv-section components
   ======================================== */
.sv-contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.sv-contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.sv-contact-item > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: var(--ink-4);
    stroke-width: 1.5;
    margin-top: 2px;
}

.sv-contact-item > div {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sv-contact-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-2);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sv-contact-value {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
}

.sv-contact-note {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-3);
}

/* Form wrapper inside sv-body */
.sv-form-wrapper {
    background: var(--ground-alt);
    padding: var(--space-6);
    border: 1px solid var(--rule);
}

/* ========================================
   Service Page — Hero
   ======================================== */
.sv-hero {
    position: relative;
    background: var(--ink);
    color: #ffffff;
    padding: 180px 0 90px;
}

.sv-hero .container {
    width: 100%;
}

.sv-hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.sv-hero-sub {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    margin-top: var(--space-4);
}

/* In-page index shown in the hero */
.sv-hero-index {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sv-index-link {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-3);
    color: rgba(255, 255, 255, 0.85);
}

.sv-index-link:hover {
    color: #ffffff;
}

.sv-index-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--signal);
}

.sv-index-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sv-index-text {
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sv-index-ja {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.05em;
}

.sv-index-arrow {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.35);
    margin-left: auto;
    transition: transform var(--ease), color var(--ease);
}

.sv-index-link:hover .sv-index-arrow {
    color: var(--signal);
    transform: translateY(2px);
}

/* ========================================
   Service Page — Sections
   ======================================== */
.sv-section {
    padding: var(--space-9) 0;
    /* アンカー移動時に固定ヘッダーと重ならない余白 */
    scroll-margin-top: 48px;
}

.sv-section[data-theme="light"] {
    background: var(--ground);
    color: var(--ink);
}

.sv-section[data-theme="dark"] {
    background: var(--ink);
    color: #ffffff;
}

/* Head: number + titles */
.sv-head {
    position: relative;
    margin-bottom: var(--space-7);
}

.sv-num {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    opacity: 0.08;
    pointer-events: none;
    user-select: none;
}

.sv-section[data-theme="light"] .sv-num {
    color: var(--ink);
}

.sv-section[data-theme="dark"] .sv-num {
    color: #ffffff;
}

.sv-title-en {
    display: block;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-top: calc(var(--space-4) * -1);
}

.sv-title-ja {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-top: var(--space-3);
}

.sv-section[data-theme="light"] .sv-title-ja {
    color: var(--ink-3);
}

.sv-section[data-theme="dark"] .sv-title-ja {
    color: rgba(255, 255, 255, 0.4);
}

/* Body: description + features */
.sv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
}

.sv-desc {
    font-size: 0.95rem;
    line-height: 2;
    max-width: 640px;
}

.sv-section[data-theme="light"] .sv-desc {
    color: var(--ink-2);
}

.sv-section[data-theme="dark"] .sv-desc {
    color: rgba(255, 255, 255, 0.85);
}

/* Features — minimal row list */
.sv-features {
    display: flex;
    flex-direction: column;
}

.sv-feat {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: default;
    transition: transform 0.3s cubic-bezier(.77, 0, .175, 1), background 0.3s ease;
}

.sv-feat svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.5;
    transition: stroke var(--ease);
}

.sv-section[data-theme="light"] .sv-feat svg {
    stroke: var(--ink-4);
}

.sv-section[data-theme="dark"] .sv-feat svg {
    stroke: rgba(255, 255, 255, 0.35);
}

.sv-feat:hover svg {
    stroke: var(--signal);
}

.sv-section[data-theme="light"] .sv-feat:hover svg {
    stroke: var(--signal-deep);
}

.sv-feat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--signal);
    transform: scaleY(0);
    transform-origin: bottom center;
    transition: transform 0.3s cubic-bezier(.77, 0, .175, 1);
}

.sv-feat:hover::before {
    transform: scaleY(1);
    transform-origin: top center;
}

.sv-feat:hover {
    transform: translateX(8px);
}

.sv-section[data-theme="light"] .sv-feat:hover {
    background: var(--ground-alt);
}

.sv-section[data-theme="dark"] .sv-feat:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Service Page — Works
   ======================================== */
.works {
    background: var(--ground-alt);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.work-card {
    background: var(--ground);
    padding: var(--space-6);
    border: 1px solid var(--rule);
    transition: border-color var(--ease);
}

.work-card:hover {
    border-color: var(--rule-strong);
    box-shadow: inset 2px 0 0 var(--signal);
}

.work-category {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--ink-3);
    background: var(--ground-alt);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--rule);
    margin-bottom: var(--space-4);
    letter-spacing: 0.05em;
    border-radius: 0;
}

.work-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.work-description {
    font-size: 0.9rem;
    color: var(--ink-2);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.work-tech span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: var(--space-1) var(--space-2);
    background: var(--ground-alt);
    border: 1px solid var(--rule);
    color: var(--ink-3);
    letter-spacing: 0.02em;
    border-radius: 0;
}

/* ========================================
   Contact Page — Form
   ======================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--ink-2);
}

.required {
    color: var(--signal-deep);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px var(--space-4);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--ground);
    border: 1px solid var(--rule-strong);
    border-radius: 0;
    transition: border-color var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--signal-deep);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--ink-4);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    background-size: 16px;
    cursor: pointer;
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
}

.form-privacy {
    margin-bottom: var(--space-6);
}

.checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ink-2);
}

/* Visually hidden but still focusable for keyboard users */
.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.checkbox-label input:focus-visible + .checkbox-custom {
    outline: 2px solid var(--signal-deep);
    outline-offset: 2px;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1px solid var(--rule-strong);
    flex-shrink: 0;
    transition: all var(--ease);
    position: relative;
    border-radius: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--signal-deep);
    border-color: var(--signal-deep);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Inline form status (replaces alert dialogs) */
.form-status {
    display: none;
    margin-top: var(--space-4);
    padding: var(--space-4);
    font-size: 0.9rem;
    line-height: 1.7;
    border: 1px solid;
}

.form-status.is-success {
    display: block;
    color: #15803d;
    border-color: #86efac;
    background: #f0fdf4;
}

.form-status.is-error {
    display: block;
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Clickable contact details */
a.sv-contact-value {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--rule-strong);
}

a.sv-contact-value:hover {
    color: var(--signal-deep);
    text-decoration-color: var(--signal-deep);
}

.sv-info-row dd a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--rule-strong);
}

.sv-info-row dd a:hover {
    color: var(--signal-deep);
    text-decoration-color: var(--signal-deep);
}

/* ========================================
   Back to Top
   ======================================== */
.to-top {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 9990;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--rule-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s,
                border-color var(--ease), color var(--ease);
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s,
                border-color var(--ease), color var(--ease);
}

.to-top:hover {
    color: var(--signal-deep);
    border-color: var(--signal-deep);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .features-grid,
    .services-grid,
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sv-body {
        grid-template-columns: 1fr;
    }

    .sv-body--message {
        grid-template-columns: 140px 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --space-9: 60px;
    }

    .gh {
        padding: var(--space-4) var(--space-5);
    }

    .gh-nav {
        display: none;
    }

    .gnav-inner {
        padding: var(--space-9) var(--space-5);
    }

    .features-grid,
    .services-grid,
    .works-grid {
        grid-template-columns: 1fr;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .hero-visual {
        justify-content: center;
    }

    .hero-visual img {
        width: min(480px, 100%);
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* 16px以上にしないとiOS Safariがフォーカス時に自動ズームする */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 1rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: var(--space-6);
    }

    .footer-nav ul {
        flex-direction: column;
        gap: var(--space-4);
    }

    .sv-hero {
        padding: 130px 0 56px;
    }

    .sv-hero-index {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sv-section {
        padding: var(--space-8) 0;
    }

    .sv-num {
        font-size: clamp(3.5rem, 20vw, 6rem);
    }

    .sv-title-en {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .sv-body {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .sv-body--message {
        grid-template-columns: 1fr;
    }

    .sv-message-photo {
        max-width: 160px;
        margin: 0 auto;
    }

    .sv-info-row {
        grid-template-columns: 1fr;
    }

    .sv-info-row dt {
        padding: var(--space-4);
    }

    .sv-info-row dd {
        padding: var(--space-4);
    }

    .sv-form-wrapper {
        padding: var(--space-5);
    }

    .sp-hide {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title-main {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.35rem;
    }

    .feature-card,
    .service-card {
        padding: var(--space-5);
    }
}
