/* ============================================================
   Aegis Eye - Common Stylesheet
   ============================================================ */

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

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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2C2C2C;
    background-color: #F7F7F7;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: #C62828;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #E53935;
}

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

ul {
    list-style: none;
}

/* --- Utility --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.pc-only {
    display: inline;
}

/* --- Variables (Custom Properties) --- */
:root {
    --primary: #C62828;
    --primary-light: #E53935;
    --primary-dark: #8E0000;
    --primary-glow: #FF5252;
    --bg: #F7F7F7;
    --surface: #FFFFFF;
    --border: #E8E8E8;
    --text: #2C2C2C;
    --text-sub: #666666;
    --header-height: 72px;
}


/* ============================================================
   Header
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo img {
    height: 36px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(198, 40, 40, 0.06);
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 700;
}

.header-cta {
    margin-left: 16px;
    font-size: 0.85rem;
    padding: 8px 20px;
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-block;
    font-family: inherit;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 10px 28px;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(198, 40, 40, 0.35);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 40px;
    font-size: 1.05rem;
    border-radius: 10px;
}


/* ============================================================
   Hero Section (Top Page)
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.35) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #FFFFFF;
    padding: 0 24px;
    max-width: 800px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero-text {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 36px;
    opacity: 0.95;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.hero .btn-primary {
    box-shadow: 0 4px 20px rgba(198, 40, 40, 0.4);
}

.hero .btn-primary:hover {
    box-shadow: 0 6px 28px rgba(198, 40, 40, 0.55);
}


/* ============================================================
   Page Hero (Sub Pages)
   ============================================================ */
.page-hero {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #FFFFFF;
    text-align: center;
}

.page-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-hero-title i {
    margin-right: 12px;
    opacity: 0.85;
}

.page-hero-text {
    font-size: 1.05rem;
    opacity: 0.9;
}


/* ============================================================
   Sections (Common)
   ============================================================ */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px;
    margin: 16px auto 0;
}

.section-lead {
    color: var(--text-sub);
    font-size: 1rem;
    margin-top: 8px;
}


/* ============================================================
   Concept Section
   ============================================================ */
.concept-section {
    background-color: var(--surface);
}

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

.concept-card {
    padding: 36px;
    background: var(--bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.concept-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF;
    font-size: 1.4rem;
    border-radius: 14px;
    margin-bottom: 20px;
}

.concept-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.concept-card p {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.8;
}


/* ============================================================
   Features Section
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF;
    font-size: 1.5rem;
    border-radius: 16px;
    margin: 0 auto 20px;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.7;
}


/* ============================================================
   System Diagram Section
   ============================================================ */
.diagram-section {
    background-color: var(--surface);
}

.diagram {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.diagram-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.diagram-row-bottom {
    justify-content: center;
    margin-top: 0;
}

.diagram-node {
    text-align: center;
    flex-shrink: 0;
    min-width: 120px;
}

.diagram-node-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF;
    font-size: 1.6rem;
    border-radius: 18px;
    margin: 0 auto 10px;
    box-shadow: 0 4px 16px rgba(198, 40, 40, 0.2);
}

.diagram-node-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.5;
}

.diagram-node-label small {
    font-weight: 400;
    color: var(--text-sub);
    font-size: 0.8rem;
}

.diagram-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
    min-width: 140px;
}

.diagram-arrow-line {
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    position: relative;
}

.diagram-arrow-line::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--primary);
}

.diagram-arrow-reverse .diagram-arrow-line::after {
    right: auto;
    left: -2px;
    border-left-color: transparent;
    border-right-color: var(--primary);
}

.diagram-arrow-text {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-top: 6px;
    white-space: nowrap;
}

.diagram-connector {
    display: flex;
    justify-content: center;
    padding: 0;
    height: 48px;
    position: relative;
}

.diagram-connector-line {
    display: block;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    position: relative;
}

.diagram-connector-line::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--primary);
}


/* ============================================================
   Steps Section
   ============================================================ */
.steps-section {
    background: var(--surface);
}

.steps {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 0;
    position: relative;
}

.step-number {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.2);
}

.step-body {
    padding-top: 6px;
}

.step-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.step-body p {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.7;
}


/* ============================================================
   Requirements Section
   ============================================================ */
.requirements-table-wrap {
    max-width: 700px;
    margin: 0 auto;
    overflow-x: auto;
}

.requirements-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.requirements-table th,
.requirements-table td {
    padding: 18px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.requirements-table tr:last-child th,
.requirements-table tr:last-child td {
    border-bottom: none;
}

.requirements-table th {
    background: var(--bg);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    width: 180px;
}

.requirements-table th i {
    margin-right: 8px;
    color: var(--primary);
}

.requirements-table td {
    color: var(--text-sub);
}

.requirements-table td small {
    color: #999;
}


/* ============================================================
   CTA Section
   ============================================================ */
.cta-section {
    background: var(--bg);
}

.cta-box {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    border-radius: 20px;
    padding: 64px 40px;
    text-align: center;
    color: #FFFFFF;
    box-shadow: 0 8px 40px rgba(198, 40, 40, 0.2);
}

.cta-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-text {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

.cta-box .btn-primary {
    background: #FFFFFF;
    color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cta-box .btn-primary:hover {
    background: #FFFFFF;
    color: var(--primary-dark);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}


/* ============================================================
   Functions Section (camera.html / admin.html)
   ============================================================ */
.page-overview {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.page-overview p {
    font-size: 1.05rem;
    color: var(--text-sub);
    line-height: 2;
}

.functions-section {
    background: var(--surface);
}

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

.function-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.function-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

.function-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF;
    font-size: 1.2rem;
    border-radius: 14px;
    flex-shrink: 0;
}

.function-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.function-body p {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.7;
}


/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #2C2C2C;
    color: #FFFFFF;
    padding: 48px 0 32px;
    text-align: center;
}

.footer-nav {
    margin-bottom: 24px;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #FFFFFF;
}

.copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}


/* ============================================================
   Scroll Animations
   ============================================================ */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in:nth-child(2) {
    animation-delay: 0.15s;
}

.fade-in:nth-child(3) {
    animation-delay: 0.3s;
}


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

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

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

    .diagram-arrow {
        min-width: 100px;
        padding: 0 8px;
    }
}


/* ============================================================
   Responsive - Mobile
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .pc-only {
        display: none;
    }

    /* Header Mobile */
    .hamburger {
        display: flex;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        align-items: stretch;
        padding: 100px 24px 40px;
        gap: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    .header-nav.open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        display: block;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .header-cta {
        margin-left: 0;
        margin-top: 16px;
        text-align: center;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    /* Mobile Overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hero Mobile */
    .hero {
        min-height: 90vh;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-text {
        font-size: 0.95rem;
    }

    /* Page Hero Mobile */
    .page-hero {
        padding-top: calc(var(--header-height) + 40px);
        padding-bottom: 40px;
    }

    .page-hero-title {
        font-size: 1.5rem;
    }

    /* Sections Mobile */
    .section {
        padding: 56px 0;
    }

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

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

    /* Features Mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    /* Diagram Mobile */
    .diagram {
        padding: 20px 0;
    }

    .diagram-row {
        flex-direction: column;
        gap: 0;
    }

    .diagram-arrow {
        min-width: auto;
        padding: 12px 0;
        transform: rotate(90deg);
        width: 100px;
    }

    .diagram-arrow-text {
        transform: rotate(-90deg);
        display: block;
        margin-top: 12px;
        font-size: 0.7rem;
    }

    .diagram-connector {
        height: 40px;
    }

    .diagram-row-bottom {
        flex-direction: column;
    }

    .diagram-arrow-reverse {
        transform: rotate(-90deg);
    }

    .diagram-arrow-reverse .diagram-arrow-text {
        transform: rotate(90deg);
    }

    /* Steps Mobile */
    .steps::before {
        left: 23px;
    }

    .step-number {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .step-item {
        gap: 18px;
        padding: 18px 0;
    }

    /* Requirements Mobile */
    .requirements-table th {
        width: auto;
        display: block;
        border-bottom: none;
        padding-bottom: 4px;
    }

    .requirements-table td {
        display: block;
        padding-top: 0;
    }

    .requirements-table tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }

    .requirements-table tr:last-child {
        border-bottom: none;
    }

    .requirements-table th,
    .requirements-table td {
        border-bottom: none;
    }

    /* CTA Mobile */
    .cta-box {
        padding: 48px 24px;
        border-radius: 16px;
    }

    .cta-title {
        font-size: 1.3rem;
    }

    /* Functions Mobile */
    .function-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }

    /* Footer Mobile */
    .footer-nav ul {
        flex-direction: column;
        gap: 12px;
    }
}


/* ============================================================
   Responsive - Small Mobile
   ============================================================ */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .btn-lg {
        padding: 12px 32px;
        font-size: 0.95rem;
    }
}
