/* assets/css/style.css — TeachStart坂上 design system (和モダン) */

:root {
    /* Surfaces */
    --color-bg-base: #F7F2EA;       /* Warm eggshell */
    --color-bg-card: #FFFFFF;       /* Clean white */
    --color-bg-neutral: #F1E9DC;    /* Unbleached linen */
    --color-bg-sink: #EFE7DA;       /* Recessed field */

    /* Text */
    --color-text-main: #2A2420;     /* Warm charcoal */
    --color-text-muted: #7A6E62;    /* Muted wood ash */
    --color-text-soft: #9A8E80;     /* Softest caption */

    /* Wood tones */
    --color-wood-primary: #9A6A43;  /* Cedar / hiba */
    --color-wood-light: #DEC2A2;    /* Hinoki plank */
    --color-wood-dark: #6F4A2E;     /* Aged oak */
    --color-wood-tint: #F3E7D8;     /* Faintest wood wash */

    /* Status */
    --color-status-success: #5C6B50; /* Matcha */
    --color-status-error: #B05B3B;   /* Terracotta */
    --color-status-warning: #C8883F; /* Autumn leaf */

    /* Lines & rings */
    --color-line: #E7DCCB;
    --color-ring: rgba(154, 106, 67, 0.35);

    /* Typography */
    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'Outfit', 'Noto Sans JP', sans-serif;

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

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --border-radius: 10px; /* legacy alias used by inline styles */

    /* Shadows (warm, layered) */
    --shadow-sm: 0 1px 2px rgba(79, 52, 32, 0.05), 0 1px 3px rgba(79, 52, 32, 0.04);
    --shadow-md: 0 4px 14px rgba(107, 74, 46, 0.08), 0 2px 6px rgba(107, 74, 46, 0.05);
    --shadow-lg: 0 18px 40px rgba(94, 64, 40, 0.14), 0 6px 14px rgba(94, 64, 40, 0.08);
    --box-shadow: var(--shadow-md); /* legacy alias */

    --max-width: 1100px;
    --header-h: 74px;
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding-bottom: var(--space-8);
    overflow-x: hidden;
}

::selection { background: var(--color-wood-light); color: var(--color-wood-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--color-text-main);
    letter-spacing: 0.02em;
    line-height: 1.4;
}

p { margin: 0; }

a {
    color: var(--color-wood-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--color-wood-dark); }

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

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-ring);
    border-radius: var(--radius-sm);
}

/* Containers */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ---------- Header & nav ---------- */
header {
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--color-line);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo a {
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.04em;
}

.logo-symbol {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: transparent;
    border: 3px solid var(--color-wood-primary);
    transform: rotate(45deg);
    position: relative;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.logo a:hover .logo-symbol { transform: rotate(135deg); }

.logo-symbol::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--color-wood-primary);
    top: 2px;
    left: 2px;
}

.logo-text-brand {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--color-wood-primary);
    letter-spacing: 0.04em;
}

.logo-text-sub {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--color-text-main);
    margin-left: 2px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease;
}

nav a:not(.nav-btn):not(.btn)::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    background: var(--color-wood-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    border-radius: 2px;
}
nav a:not(.nav-btn):not(.btn):hover::after,
nav a:not(.nav-btn):not(.btn).active::after { transform: scaleX(1); }

nav a:not(.nav-btn):not(.btn):hover,
nav a:not(.nav-btn):not(.btn).active { color: var(--color-wood-primary); }

.nav-btn {
    background-color: var(--color-wood-primary);
    color: #fff !important;
    padding: 9px 20px !important;
    border-radius: var(--radius-pill);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.nav-btn:hover {
    background-color: var(--color-wood-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */
footer {
    background: linear-gradient(180deg, var(--color-bg-neutral), var(--color-wood-tint));
    padding: 48px 0;
    margin-top: var(--space-8);
    border-top: 1px solid var(--color-wood-light);
    color: var(--color-text-muted);
    font-size: 13px;
}

footer .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

footer ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    list-style: none;
}

footer a { color: var(--color-text-muted); }
footer a:hover { color: var(--color-wood-primary); }
footer p { letter-spacing: 0.03em; }

/* ---------- Page headers & section titles ---------- */
.page-header {
    padding: 8px 0 24px 0;
    border-bottom: 1px solid var(--color-line);
    margin-bottom: var(--space-7);
}

.page-header h1 {
    font-size: clamp(24px, 4vw, 30px);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 15px;
    max-width: 70ch;
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-wood-primary);
    margin-bottom: 10px;
}

.section-title {
    font-size: clamp(21px, 3.4vw, 26px);
    text-align: center;
    margin-bottom: var(--space-7);
}
.section-title::after {
    content: '';
    display: block;
    width: 44px;
    height: 2px;
    background: var(--color-wood-primary);
    margin: 14px auto 0 auto;
    border-radius: 2px;
}
.section-title.left { text-align: left; }
.section-title.left::after { margin-left: 0; }

section { scroll-margin-top: calc(var(--header-h) + 24px); }

/* ---------- Cards ---------- */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-hover {
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-wood-light);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Numbered step marker */
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    background: var(--color-wood-tint);
    color: var(--color-wood-primary);
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    border: 1px solid var(--color-wood-light);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, #A6744C, var(--color-wood-primary));
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--color-wood-primary), var(--color-wood-dark));
    color: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--color-wood-light);
    color: var(--color-wood-primary);
}
.btn-secondary:hover {
    background-color: var(--color-wood-tint);
    border-color: var(--color-wood-primary);
    color: var(--color-wood-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--color-status-error);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-danger:hover { background-color: #97492d; color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-main);
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background-color: var(--color-bg-sink);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control::placeholder { color: var(--color-text-soft); }
.form-control:focus {
    outline: none;
    border-color: var(--color-wood-primary);
    background-color: var(--color-bg-card);
    box-shadow: 0 0 0 3px var(--color-ring);
}

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.checkbox-group, .radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    background: var(--color-bg-sink);
    padding: 10px 14px;
    border-radius: var(--radius);
    user-select: none;
    border: 1px solid var(--color-line);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.checkbox-label input, .radio-label input { cursor: pointer; accent-color: var(--color-wood-primary); }
.checkbox-label:hover, .radio-label:hover {
    border-color: var(--color-wood-light);
    background: var(--color-wood-tint);
}

/* ---------- Alerts ---------- */
.alert {
    padding: 15px 18px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background-color: #E6EDE4; color: #445039; border-color: #cfdcc7; border-left: 4px solid var(--color-status-success); }
.alert-danger  { background-color: #F7E9E3; color: #8a4327; border-color: #eccfc2; border-left: 4px solid var(--color-status-error); }
.alert-info    { background-color: var(--color-wood-tint); color: var(--color-text-main); border-color: var(--color-line); border-left: 4px solid var(--color-wood-primary); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-line);
    font-size: 14px;
}
th {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: var(--color-bg-sink);
}
thead th:first-child { border-top-left-radius: var(--radius); }
thead th:last-child { border-top-right-radius: var(--radius); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color 0.15s ease; }
tbody tr:hover td { background-color: var(--color-wood-tint); }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 4px 11px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
    line-height: 1.5;
}
.badge-success { background-color: #E6EDE4; color: #4b5a3f; }
.badge-danger  { background-color: #F7E1D8; color: #9a4526; }
.badge-warning { background-color: #FBEDD8; color: #9a6a24; }

/* ---------- Dashboard metrics ---------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-top: 3px solid var(--color-wood-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metric-card:first-child { border-top-color: var(--color-wood-primary); }

.metric-value {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 700;
    color: var(--color-wood-primary);
    margin: 8px 0;
    line-height: 1.1;
}
.metric-label { font-size: 12px; color: var(--color-text-muted); font-weight: 600; letter-spacing: 0.04em; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: clamp(48px, 8vw, 88px) clamp(24px, 5vw, 60px);
    margin-bottom: var(--space-8);
    text-align: center;
    background-color: var(--color-wood-dark);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-lg);
    isolation: isolate;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(42, 28, 18, 0.55), rgba(42, 28, 18, 0.78)),
        radial-gradient(120% 90% at 50% 0%, rgba(154, 106, 67, 0.35), transparent 70%);
}
.hero .hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    margin-bottom: 22px;
}
.hero h1 {
    color: #fff;
    font-size: clamp(26px, 5vw, 40px);
    line-height: 1.45;
    margin-bottom: 18px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.hero .hero-sub {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(15px, 2.2vw, 19px);
    font-weight: 500;
    color: var(--color-wood-light);
    margin-top: 14px;
}
.hero .hero-lead {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(14px, 1.8vw, 16px);
    line-height: 1.9;
    max-width: 720px;
    margin: 0 auto 32px auto;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.hero .btn-secondary {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-wood-dark);
    border-color: #fff;
}

/* Pricing tag */
.price-value {
    font-size: 34px;
    margin: 10px 0;
    color: var(--color-wood-primary);
    font-family: var(--font-serif);
    font-weight: 700;
}
.price-value span { font-size: 14px; color: var(--color-text-muted); font-weight: 400; }

/* ---------- Utilities ---------- */
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.btn-group { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.doc-scroll { max-height: 260px; overflow-y: auto; }
.doc-scroll h4 { margin-top: 14px; margin-bottom: 4px; color: var(--color-text-main); font-size: 14px; }
.doc-scroll h4:first-child { margin-top: 0; }

/* Legacy responsive helper */
.br-desktop { display: inline; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    header .header-inner { flex-direction: column; gap: 14px; text-align: center; }
    nav ul { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 18px; }
    .page-header { text-align: center; }
    .page-header p { margin-left: auto; margin-right: auto; }
    .section-title.left { text-align: center; }
    .section-title.left::after { margin-left: auto; }
    th, td { padding: 11px 10px; font-size: 13px; }
    .br-desktop { display: none; }
}

@media (max-width: 576px) {
    body { padding-bottom: var(--space-6); }
    .container { padding: 0 16px; }
    .card { padding: 22px 18px; }
    .form-row { flex-direction: column; gap: 0; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
