/* ----------------------------------------------------
   5. General Layout & Sections
---------------------------------------------------- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 50px;
}

.section-padding {
    padding: 150px 0;
    position: relative;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
}

.sticky-title {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.section-num {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 20px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-top: 20px;
}

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

/* ----------------------------------------------------
   6. Identity Section (About)
---------------------------------------------------- */
.text-large {
    font-size: 28px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 60px;
}

.identity-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 60px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 500;
    color: #fff;
}

.stat-lbl {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ----------------------------------------------------
   7. Capabilities Section (Cards)
---------------------------------------------------- */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.capability-card-wrapper {
    perspective: 1200px;
    transform-style: preserve-3d;
    width: 100%;
    height: 100%;
}

.capability-card {
    position: relative;
    height: 100%;
    border-radius: 16px;
    cursor: pointer;
    transform-style: preserve-3d;
}

/* 静止層: backdrop-filter + 裏画像 + glow */
.card-glass {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    overflow: hidden;
    background-color: rgba(13, 15, 20, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    transition: border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease;
}

.capability-card:hover .card-glass {
    border-color: rgba(255, 255, 255, 0.08);
    background-color: rgba(18, 22, 30, 0.18);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Card Back Hover Image */
.card-hover-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.capability-card:hover .card-hover-image-wrapper {
    opacity: 0.4; /* Glass backside image visibility */
}

.card-hover-image {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    object-fit: cover;
    filter: grayscale(100%) brightness(120%) contrast(110%);
    transition: transform 0.2s ease-out; /* Smooth parallax */
}

/* Stripe-style Glow Background */
.card-bg-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(350px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), var(--glow-color, rgba(37, 99, 235, 0.15)) 0%, rgba(0,0,0,0) 80%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.capability-card:hover .card-bg-glow {
    opacity: 1;
}

/* tilt層: コンテンツのみ。GSAPでrotateX/Y を適用。
   position:relative で通常フローに置き、この層がカード高さを決める
   （.card-glass は absolute;inset:0 で背面を埋める） */
.card-tilt-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 60px 50px;
    z-index: 4;
    transform-style: preserve-3d;
    will-change: transform;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateZ(30px);
}

.card-num {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--text-muted);
}

.card-icon {
    width: 32px;
    height: 32px;
    color: var(--glow-color, var(--accent));
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 500;
    color: #fff;
    transform: translateZ(40px);
}

.card-desc {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    transform: translateZ(20px);
}

/* Vercel-style border glow using mask technique */
.card-border-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    pointer-events: none;
    z-index: 3;
    padding: 1px; /* border thickness */
    background: radial-gradient(250px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), var(--glow-color, rgba(37, 99, 235, 0.45)) 0%, rgba(255,255,255,0.03) 40%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.capability-card:hover .card-border-glow {
    opacity: 1;
}

/* ----------------------------------------------------
   8. Interface Section (Terminal)
---------------------------------------------------- */
.desc-muted {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 320px;
    margin-top: 20px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 50px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

.pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.terminal-container {
    background-color: #0b0c10;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    height: 500px;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background-color: #12141a;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.t-btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.t-btn.red { background-color: #ef4444; }
.t-btn.yellow { background-color: #f59e0b; }
.t-btn.green { background-color: #10b981; }

.terminal-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.terminal-badge {
    margin-left: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
}

.terminal-body {
    padding: 25px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.log-line {
    word-break: break-all;
}

.log-line.system {
    color: var(--text-muted);
}

.log-line.input {
    color: #fff;
    display: flex;
    gap: 8px;
}

.log-line.input::before {
    content: '>';
    color: var(--accent);
    font-weight: bold;
}

.log-line.output {
    color: #60a5fa;
    padding-left: 15px;
    border-left: 1.5px solid var(--accent);
}
