:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-dark: #f1f3f5;

    --text: #20252b;
    --text-sub: #66707a;
    --text-light: #8a939c;

    --border: #e1e5e8;

    --primary: #243447;
    --primary-hover: #182633;

    --accent: #3d6b8c;
    --ok: #5c8a67;

    --max-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Helvetica Neue",
        "Yu Gothic",
        "YuGothic",
        "Hiragino Kaku Gothic ProN",
        "Meiryo",
        sans-serif;

    line-height: 1.8;
}

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

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

/* =========================================
   Header
========================================= */

.header {
    position: sticky;
    top: 0;
    z-index: 100;

    height: 68px;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.nav {
    display: flex;
    gap: 32px;

    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
}

.nav a {
    transition: color 0.2s ease;
}

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


/* =========================================
   Hero
========================================= */

.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px 24px 110px;
}

.hero-label {
    margin-bottom: 20px;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--accent);
}

.hero-title {
    max-width: 760px;

    margin: 0 0 28px;

    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.25;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.hero-description {
    max-width: 680px;

    margin: 0 0 38px;

    font-size: 16px;
    color: var(--text-sub);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 150px;
    height: 46px;

    padding: 0 22px;

    border: 1px solid var(--primary);

    font-size: 13px;
    font-weight: 700;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-secondary {
    background: #fff;
    color: var(--primary);
}

.button-secondary:hover {
    background: var(--surface-dark);
}


/* =========================================
   Common（トップページのセクション枠）
========================================= */

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

.section-header {
    margin-bottom: 48px;
}

.section-number {
    margin-bottom: 8px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
}

.section-title {
    margin: 0;

    font-size: 30px;
    line-height: 1.4;
}

.section-description {
    margin: 12px 0 0;

    font-size: 14px;
    color: var(--text-sub);
}


/* =========================================
   Works
========================================= */

.works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.work-card {
    background: var(--surface);

    border: 1px solid var(--border);

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.work-card:hover {
    border-color: #c8ced3;

    transform: translateY(-2px);

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.work-image {
    height: 220px;

    background:
        linear-gradient(
            135deg,
            #e9edf0 0%,
            #f6f7f8 100%
        );

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-light);

    font-size: 12px;
    letter-spacing: 0.08em;

    overflow: hidden;
}

.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-content {
    padding: 28px;
}

.work-number {
    margin-bottom: 8px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-light);
}

.work-title {
    margin: 0 0 10px;

    font-size: 21px;
    line-height: 1.5;
}

.work-description {
    min-height: 74px;

    margin: 0 0 20px;

    font-size: 13px;
    color: var(--text-sub);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-bottom: 24px;
}

.tag {
    display: inline-flex;
    align-items: center;

    padding: 4px 9px;

    border: 1px solid var(--border);

    background: #fafbfc;

    font-size: 11px;
    color: var(--text-sub);
}

.work-footer {
    padding-top: 20px;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 11px;
    color: var(--text-sub);
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: var(--ok);
}

.work-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.work-link::after {
    content: " →";
}


/* =========================================
   About
========================================= */

.about {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 100px 24px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
}

.about-text {
    font-size: 14px;
    color: var(--text-sub);
}

.about-text p {
    margin: 0 0 18px;
}

.skill-list {
    display: grid;
    gap: 0;

    border-top: 1px solid var(--border);
}

.skill-item {
    display: grid;
    grid-template-columns: 150px 1fr;

    padding: 17px 0;

    border-bottom: 1px solid var(--border);

    font-size: 13px;
}

.skill-name {
    font-weight: 700;
}

.skill-value {
    color: var(--text-sub);
}


/* =========================================
   Development Philosophy
========================================= */

.principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.principle {
    padding: 26px;

    background: var(--surface);

    border: 1px solid var(--border);
}

.principle-number {
    margin-bottom: 20px;

    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.principle-title {
    margin: 0 0 12px;

    font-size: 17px;
}

.principle-text {
    margin: 0;

    font-size: 13px;
    color: var(--text-sub);
}

/* =========================================
    Breadcrumb / Back（詳細ページ）
========================================= */

.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 28px 24px 0;

    font-size: 12px;
    color: var(--text-light);
}

.breadcrumb a {
    font-weight: 700;
    color: var(--accent);
}

.breadcrumb a:hover {
    text-decoration: underline;
}


/* =========================================
    Project Hero（詳細ページ）
========================================= */

.project-hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.project-number {
    margin-bottom: 14px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
}

.project-title {
    max-width: 760px;

    margin: 0 0 18px;

    font-size: clamp(28px, 4.2vw, 44px);
    line-height: 1.35;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.project-lead {
    max-width: 680px;

    margin: 0 0 30px;

    font-size: 15px;
    color: var(--text-sub);
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;

    padding-top: 26px;
    margin-bottom: 30px;

    border-top: 1px solid var(--border);
}

.meta-item {
    font-size: 12px;
}

.meta-label {
    margin-bottom: 6px;

    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-light);
}

.meta-value {
    font-size: 13px;
    color: var(--text-sub);
}

.project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


/* =========================================
    Screenshot（詳細ページ）
========================================= */

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

.screenshot-frame {
    height: 440px;

    background:
        linear-gradient(
            135deg,
            #e9edf0 0%,
            #f6f7f8 100%
        );

    border: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-light);

    font-size: 12px;
    letter-spacing: 0.08em;
}

.screenshot-caption {
    margin-top: 14px;

    font-size: 12px;
    color: var(--text-light);
}

.screenshot-img {
    width: 100%;
    display: block;

    border: 1px solid var(--border);
    background: #fff;
}

.screenshot-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .screenshot-row {
        grid-template-columns: 1fr;
    }
}


/* =========================================
    Detail sections（詳細ページの中身）
    トップページの .section / .section-title と
    名前が衝突していたため、詳細ページ専用の
    クラス名に分離しています。
========================================= */

.detail-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 100px;
}

.detail-section-title {
    margin: 0;

    font-size: 24px;
    line-height: 1.5;
}

.body-text {
    max-width: 760px;

    font-size: 14px;
    color: var(--text-sub);
}

.body-text p {
    margin: 0 0 18px;
}


/* =========================================
    Architecture list
========================================= */

.arch-list {
    display: grid;
    gap: 0;

    border-top: 1px solid var(--border);
}

.arch-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;

    padding: 20px 0;

    border-bottom: 1px solid var(--border);
}

.arch-name {
    font-size: 13px;
    font-weight: 700;
}

.arch-value {
    font-size: 13px;
    color: var(--text-sub);
}


/* =========================================
    Highlight cards (技術的な工夫)
========================================= */

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .highlight-grid {
        grid-template-columns: 1fr;
    }
}

.highlight-card {
    padding: 26px;

    background: var(--surface);

    border: 1px solid var(--border);
}

.highlight-number {
    margin-bottom: 16px;

    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.highlight-title {
    margin: 0 0 10px;

    font-size: 15px;
}

.highlight-text {
    margin: 0;

    font-size: 13px;
    color: var(--text-sub);
}


/* =========================================
    Timeline (つまずいた点と解決)
========================================= */

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

.timeline-item {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 18px;

    padding: 24px 0;

    border-bottom: 1px solid var(--border);
}

.timeline-dot-wrap {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;

    border-radius: 50%;
    background: var(--accent);
}

.timeline-problem {
    margin: 0 0 6px;

    font-size: 13px;
    font-weight: 700;
}

.timeline-solution {
    margin: 0;

    font-size: 13px;
    color: var(--text-sub);
}

.timeline-solution::before {
    content: "→ ";
    font-weight: 700;
    color: var(--accent);
}


/* =========================================
    Next project nav
========================================= */

.next-project {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 50px 24px;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.next-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-light);

    margin-bottom: 8px;
}

.next-title {
    font-size: 18px;
    font-weight: 700;
}

.next-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.next-link::after {
    content: " →";
}

/* =========================================
    Contact Form
========================================== */

.contact-form {
    max-width: 560px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;

    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
}

.form-input,
.form-textarea {
    width: 100%;

    padding: 12px 14px;

    background: var(--surface);
    border: 1px solid var(--border);

    font-size: 14px;
    font-family: inherit;
    color: var(--text);

    transition: border-color 0.2s ease;
}

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

.form-textarea {
    resize: vertical;
}

.honeypot-field {
    position: absolute;
    left: -9999px;

    width: 1px;
    height: 1px;

    overflow: hidden;
}

.form-submit {
    border: none;
    cursor: pointer;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.form-message {
    margin: 14px 0 0;

    font-size: 13px;
}

.form-message-success {
    color: #5c8a67;
}

.form-message-error {
    color: #b1493f;
}


/* =========================================
   Footer
========================================= */

.footer {
    background: var(--primary);
    color: #fff;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 55px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.footer-title {
    margin: 0 0 5px;

    font-size: 15px;
    font-weight: 700;
}

.footer-text {
    margin: 0;

    font-size: 11px;
    color: rgba(255,255,255,0.65);
}

.footer-link {
    font-size: 13px;
    font-weight: 700;
}


/* =========================================
   Responsive
========================================= */

@media (max-width: 768px) {

    .header {
        height: 60px;
    }

    .nav {
        display: none;
    }

    .hero-inner {
        padding: 80px 20px;
    }

    .section {
        padding: 70px 20px;
    }

    .detail-section {
        padding: 0 20px 70px;
    }

    .about-inner {
        padding: 70px 20px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-description {
        font-size: 14px;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .principles {
        grid-template-columns: 1fr;
    }

    .work-description {
        min-height: auto;
    }

    .arch-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .footer-inner {
        padding: 45px 20px;

        flex-direction: column;
        align-items: flex-start;
    }
}
