@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Montserrat:wght@400;700;900&display=swap');

:root {
    --primary-color: #0a0a0a;
    /* Almost black */
    --secondary-color: #ffffff;
    --accent-color: #D32F2F;
    /* Deep Red */
    --text-color: #e0e0e0;
    /* Off-white for dark mode feel */
    --text-dark: #333333;
    --bg-dark: #111111;
    --bg-light: #f9f9f9;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--secondary-color);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

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

/* --- Navigation --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    padding: 1.5rem 0;
    background: transparent;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--secondary-color);
    /* White initially */
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
    width: auto;
}

header.scrolled .logo {
    color: var(--primary-color);
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-links li a {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

header.scrolled .nav-links li a {
    color: var(--primary-color);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 30px;
    height: 2px;
    margin: 6px auto;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

header.scrolled .bar {
    background-color: var(--primary-color);
}

/* Keep header text white on pages that have a dark header (inline style or `.dark` class) */
header.dark,
header[style*="#0a0a0a"] {
    background: var(--primary-color);
}

header.dark .logo,
header[style*="#0a0a0a"] .logo,
header.dark .nav-links li a,
header[style*="#0a0a0a"] .nav-links li a {
    color: var(--secondary-color);
}

header.dark.scrolled,
header[style*="#0a0a0a"].scrolled {
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

header.dark.scrolled .logo,
header[style*="#0a0a0a"].scrolled .logo,
header.dark.scrolled .nav-links li a,
header[style*="#0a0a0a"].scrolled .nav-links li a {
    color: var(--secondary-color);
}

header.dark .bar,
header[style*="#0a0a0a"] .bar,
header.dark.scrolled .bar,
header[style*="#0a0a0a"].scrolled .bar {
    background-color: var(--secondary-color);
}

header.dark .hamburger.active .bar,
header[style*="#0a0a0a"] .hamburger.active .bar {
    background-color: var(--secondary-color);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    padding-top: 80px;
    /* Account for fixed header */
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4)), url('../assets/banner.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    width: 100%;
    height: 100%;
    text-align: center;
}

.hero-content {
    padding: 2rem 0 2rem;
    opacity: 0;
    transform: translateY(-30px);
    animation: fadeInDown 1s ease forwards 0.2s;
    text-align: center;
}

.hero-big-logo {
    width: 150px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    animation: fadeInUp 1s ease forwards 0.3s;
    opacity: 0;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.3rem;
    font-weight: 300;
    margin: 0 auto 3rem auto;
    letter-spacing: 0.5px;
    max-width: 600px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    color: var(--secondary-color);
}

.hero-image {
    position: relative;
    height: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(30px);
    /* Slide up from bottom */
    animation: fadeInUp 1s ease forwards 0.5s;
    /* Animate from bottom */
    margin-bottom: 2rem;
}

.hero-image img {
    max-width: 100%;
    max-height: 78vh;
    /* Adjust height to fit with text - increased by 30% */
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.9));
    /* Stronger shadow */
    transform: scale(1.37);
    transform-origin: bottom center;
    transition: transform 0.5s ease;
}

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

.btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    color: var(--secondary-color);
}

/* --- Sections --- */
section {
    padding: 3rem 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 5rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 15px auto 0;
}

/* --- About Preview --- */
.about-preview {
    background-color: var(--secondary-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.about-text p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #555;
}

.about-image {
    height: 500px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.8s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

/* --- Philosophy --- */
.philosophy {
    background-color: var(--bg-dark);
    color: var(--secondary-color);
    text-align: center;
    padding: 10rem 0;
}

.philosophy h2 {
    color: var(--secondary-color);
}

.philosophy p {
    font-size: 2rem;
    font-weight: 300;
    font-style: italic;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Cards (Dojo/News) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.dojo-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.dojo-layout .card:first-child {
    grid-column: 1 / -1;
}

.card {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 0;
    /* Sharp edges for modern feel */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-top: 3px solid transparent;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent-color);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card p {
    color: #666;
    margin-bottom: 0.5rem;
}

/* --- Contact Form --- */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    background: #f9f9f9;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

/* --- Footer --- */
footer {
    background: var(--primary-color);
    color: #888;
    padding: 5rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-section h3 {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
    display: inline-block;
}

.footer-section ul li {
    margin-bottom: 1rem;
}

.footer-explore-grid {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 0 3rem;
    list-style: none;
    padding: 0;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #222;
    font-size: 0.9rem;
}

/* --- Gallery and Events --- */
/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start;
    margin-top: 2rem;
}

/* Individual gallery item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f4f4f4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: saturate(1.05) contrast(1.02);
}

.gallery-caption {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Events (extends .card) */
.event-date {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.95rem;
}

.event-meta {
    color: #777;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.event-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Animations --- */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Responsive --- */
@media (max-width: 968px) {
    .hero-image img {
        max-height: 65vh;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

/* ========================================
   LINEAGE TREE SECTION
   Japanese/Okinawa Inspired Design
======================================== */

.lineage-section {
    position: relative;
    padding: 6rem 0;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    overflow: hidden;
}

/* Background Decorative Elements */
.lineage-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* Seigaiha (Japanese Wave Pattern) */
.seigaiha-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image:
        radial-gradient(circle at 0% 50%, transparent 70%, rgba(211, 47, 47, 0.3) 70.5%, transparent 71%),
        radial-gradient(circle at 100% 50%, transparent 70%, rgba(211, 47, 47, 0.3) 70.5%, transparent 71%),
        radial-gradient(circle at 50% 0%, transparent 70%, rgba(211, 47, 47, 0.3) 70.5%, transparent 71%),
        radial-gradient(circle at 50% 100%, transparent 70%, rgba(211, 47, 47, 0.3) 70.5%, transparent 71%);
    background-size: 60px 30px;
    background-position: 0 0, 30px 15px, 0 0, 30px 15px;
    animation: waveFloat 20s linear infinite;
}

@keyframes waveFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(30px);
    }
}

/* Bamboo Decorations */
.bamboo-left,
.bamboo-right {
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(76, 153, 76, 0.05) 30%,
            rgba(76, 153, 76, 0.08) 50%,
            rgba(76, 153, 76, 0.05) 70%,
            transparent 100%);
}

.bamboo-left {
    left: 0;
}

.bamboo-right {
    right: 0;
}

.bamboo-left::before,
.bamboo-left::after,
.bamboo-right::before,
.bamboo-right::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg,
            transparent,
            rgba(100, 180, 100, 0.15) 10%,
            rgba(100, 180, 100, 0.2) 50%,
            rgba(100, 180, 100, 0.15) 90%,
            transparent);
}

.bamboo-left::before {
    left: 20px;
}

.bamboo-left::after {
    left: 50px;
}

.bamboo-right::before {
    right: 20px;
}

.bamboo-right::after {
    right: 50px;
}

/* Lineage Title */
.lineage-title {
    text-align: center;
    font-size: 2.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-shadow: 0 0 30px rgba(211, 47, 47, 0.3);
}

.kanji-decoration {
    font-size: 3.5rem;
    color: var(--accent-color);
    font-family: "Hiragino Mincho Pro", "Yu Mincho", serif;
    text-shadow: 0 0 20px rgba(211, 47, 47, 0.5);
    animation: kanjiPulse 3s ease-in-out infinite;
}

@keyframes kanjiPulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.lineage-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    margin-bottom: 4rem;
    letter-spacing: 2px;
}

/* Lineage Tree Container */
.lineage-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Each Level */
.lineage-level {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.lineage-level.horizontal-row {
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 100%;
    padding: 0 1rem;
}

/* Individual Node */
.lineage-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 1.5rem;
    transition: all 0.4s ease;
}

/* Connector line below horizontal line to student nodes */
.lineage-level.horizontal-row>.lineage-node.student::before,
.lineage-level.horizontal-row>.yonesato-branch-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, var(--accent-color), rgba(211, 47, 47, 0.3));
}

/* Red dot at the top of connector line (touching horizontal line) */
.lineage-level.horizontal-row>.lineage-node.student::after,
.lineage-level.horizontal-row>.yonesato-branch-wrapper::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
}

.lineage-node:hover {
    transform: translateY(-5px);
}

/* Node Glow Effect */
.node-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: glowPulse 4s ease-in-out infinite;
}

.node-glow.gold {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
}

.node-glow.india-glow {
    background: radial-gradient(circle, rgba(255, 153, 51, 0.3) 0%, rgba(19, 136, 8, 0.2) 50%, transparent 70%);
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Photo Frame */
.photo-frame {
    width: 156px;
    height: 156px;
    position: relative;
    z-index: 1;
}

.founder .photo-frame,
.master .photo-frame,
.grandmaster .photo-frame {
    width: 182px;
    height: 182px;
}

.student .photo-frame {
    width: 130px;
    height: 130px;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border: 3px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(211, 47, 47, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
}

.founder .photo-placeholder {
    border-width: 4px;
    box-shadow:
        0 0 30px rgba(211, 47, 47, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.gold-frame .photo-placeholder,
.gold-bg {
    border-color: #ffd700 !important;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.5) !important;
}

.india-frame .photo-placeholder,
.india-bg {
    border-color: #ff9933 !important;
    background: linear-gradient(135deg, #1a2e1a 0%, #2d442d 100%) !important;
    box-shadow:
        0 0 30px rgba(255, 153, 51, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.5) !important;
}

.placeholder-icon {
    font-size: 2.5rem;
    font-family: "Hiragino Mincho Pro", "Yu Mincho", serif;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.student .placeholder-icon {
    font-size: 2rem;
    font-family: var(--font-heading);
}

/* Frame Decoration (corner accents) */
.frame-decoration {
    display: none;
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid rgba(211, 47, 47, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

.frame-decoration::before,
.frame-decoration::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--accent-color);
}

.frame-decoration::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.frame-decoration::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

/* Node Info */
.node-info {
    text-align: center;
    margin-top: 1rem;
    z-index: 1;
}

.sensei-name {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.25rem;
    text-transform: none;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.student .sensei-name {
    font-size: 0.95rem;
}

.sensei-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.era-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(211, 47, 47, 0.2);
    border: 1px solid rgba(211, 47, 47, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 1px;
}

.gold-badge {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: rgba(255, 215, 0, 0.4) !important;
    color: #ffd700 !important;
}

.india-badge {
    background: linear-gradient(90deg, rgba(255, 153, 51, 0.2), rgba(19, 136, 8, 0.2)) !important;
    border-color: rgba(255, 153, 51, 0.4) !important;
    color: #ff9933 !important;
}

/* ========================
   TREE CONNECTORS
======================== */

.tree-connector {
    position: relative;
    z-index: 1;
}

/* Vertical Connector */
.tree-connector.vertical {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.connector-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-color), rgba(211, 47, 47, 0.3));
    position: relative;
}

.connector-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
}

.connector-ornament {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: #1a1a2e;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(211, 47, 47, 0.3);
}

.connector-ornament span {
    font-family: "Hiragino Mincho Pro", "Yu Mincho", serif;
    font-size: 1rem;
    color: var(--accent-color);
}

/* Branch Connector (one to many) */
.tree-connector.branch {
    height: 40px;
    width: 95%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.branch-stem {
    width: 2px;
    height: 38px;
    background: linear-gradient(180deg, var(--accent-color), rgba(211, 47, 47, 0.5));
}

.branch-horizontal {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(211, 47, 47, 0.5) 5%,
            var(--accent-color) 50%,
            rgba(211, 47, 47, 0.5) 95%,
            transparent 100%);
    position: absolute;
    bottom: 0;
}

/* Sub-branch (Yonesato to Vijaya Kumar) */
.yonesato-branch-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.sub-branch-indicator {
    display: none;
}

.tree-connector.sub-branch {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sub-connector-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(255, 153, 51, 0.8),
            rgba(19, 136, 8, 0.5));
    position: relative;
    margin: 0 auto;
}

.sub-connector-line::before,
.sub-connector-line::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sub-connector-line::before {
    top: 0;
    background: #ff9933;
    box-shadow: 0 0 10px #ff9933;
}

.sub-connector-line::after {
    bottom: 0;
    background: #138808;
    box-shadow: 0 0 10px #138808;
}

/* India Branch Styling */
.india-branch {
    position: relative;
}

.india-flag-accent {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #ff9933 33%, #fff 33% 66%, #138808 66%);
    border-radius: 2px;
    opacity: 0.7;
}

/* Highlight Node (Yonesato) */
.highlight-node {
    position: relative;
}


/* ========================
   LEGEND
======================== */

.lineage-legend {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid;
}

.founder-icon {
    border-color: var(--accent-color);
    background: rgba(211, 47, 47, 0.2);
}

.master-icon {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.india-icon {
    border-color: #ff9933;
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.2), rgba(19, 136, 8, 0.2));
}

/* ========================
   RESPONSIVE STYLES
======================== */

@media (max-width: 968px) {
    .lineage-title {
        font-size: 2rem;
        gap: 1rem;
    }

    .kanji-decoration {
        font-size: 2.5rem;
    }

    .lineage-level.horizontal-row {
        gap: 1rem;
    }

    .tree-connector.branch {
        width: 90%;
    }

    .lineage-legend {
        gap: 1.5rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hamburger.active .bar {
        background-color: var(--primary-color);
    }

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

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

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

    .nav-links {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 100%;
        background: var(--primary-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li a {
        color: var(--secondary-color) !important;
        font-size: 1.5rem;
    }

    .hamburger.active .bar {
        background-color: var(--secondary-color) !important;
    }

    header.nav-active .logo {
        color: var(--secondary-color) !important;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

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

    .about-image {
        height: 300px;
        order: -1;
    }

    .dojo-layout {
        grid-template-columns: 1fr;
    }

    /* Gallery on mobile: single column */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item img {
        height: 180px;
    }

    /* Lineage Tree Mobile Styles */
    .lineage-section {
        padding: 4rem 0;
    }

    .lineage-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .kanji-decoration {
        font-size: 2rem;
    }

    .lineage-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .lineage-level.horizontal-row {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .lineage-node {
        padding: 1rem;
    }

    .photo-frame {
        width: 117px;
        height: 117px;
    }

    .founder .photo-frame,
    .master .photo-frame,
    .grandmaster .photo-frame {
        width: 143px;
        height: 143px;
    }

    .student .photo-frame {
        width: 104px;
        height: 104px;
    }

    .placeholder-icon {
        font-size: 1.8rem;
    }

    .student .placeholder-icon {
        font-size: 1.5rem;
    }

    .sensei-name {
        font-size: 1rem;
    }

    .student .sensei-name {
        font-size: 0.9rem;
    }

    .tree-connector.vertical {
        height: 50px;
    }

    .connector-ornament {
        width: 28px;
        height: 28px;
    }

    .connector-ornament span {
        font-size: 0.8rem;
    }

    .tree-connector.branch {
        height: 40px;
        width: 60px;
    }

    .branch-stem {
        height: 25px;
    }

    .branch-horizontal {
        display: none;
    }

    /* Hide node connectors on mobile since layout is vertical */
    .lineage-level.horizontal-row>.lineage-node.student::before,
    .lineage-level.horizontal-row>.lineage-node.student::after,
    .lineage-level.horizontal-row>.yonesato-branch-wrapper::before,
    .lineage-level.horizontal-row>.yonesato-branch-wrapper::after {
        display: none;
    }

    .highlight-node::after {
        display: none;
    }

    .tree-connector.sub-branch {
        height: 40px;
    }

    .lineage-legend {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 2rem;
    }

    .bamboo-left,
    .bamboo-right {
        display: none;
    }

    .node-glow {
        width: 120px;
        height: 120px;
    }
}