:root {
    --apple-bg: #ffffff;
    --apple-text: #1d1d1f;
    --apple-grey: #f5f5f7;
    --apple-blue: #0066cc;
    --sidebar-width: 280px;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Myriad Set Pro", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--apple-bg);
    color: var(--apple-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 44px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--apple-text);
    z-index: 1001;
    user-select: none;
    -webkit-user-select: none;
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
}

nav a {
    color: var(--apple-text);
    text-decoration: none;
    font-size: 12px;
    margin: 0 20px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 1;
}

nav a.active {
    opacity: 1;
    font-weight: 600;
}

/* Hero Sections */
section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 20px;
}

h2 {
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 20px;
}

p {
    font-size: 21px;
    color: #86868b;
    max-width: 800px;
    margin: 0 auto 30px;
}

.bg-grey {
    background-color: var(--apple-grey);
    max-width: 100%;
}

/* Confluence Style Writings */
#writings {
    display: flex;
    text-align: left;
    max-width: 1400px;
    gap: 40px;
}

.writing-sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding-right: 20px;
}

.writing-sidebar ul {
    list-style: none;
}

.writing-sidebar li {
    margin-bottom: 10px;
    font-weight: 500;
}

.writing-sidebar ul ul {
    margin-left: 20px;
    margin-top: 5px;
    font-weight: 400;
    font-size: 14px;
}

.writing-content {
    flex: 1;
}

/* About Me Page */
.about-profile {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    text-align: left;
}

.about-portrait {
    flex-shrink: 0;
}

.about-portrait img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.about-intro h2 {
    font-size: 36px;
    margin-bottom: 4px;
    text-align: left;
}

.about-role {
    font-size: 15px !important;
    color: var(--apple-blue) !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 20px !important;
}

.about-intro p {
    text-align: left;
    margin-left: 0;
}

.about-details {
    padding: 80px 20px;
    max-width: 100%;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    padding: 40px 30px;
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.about-card-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.about-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.about-card p {
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    text-align: left;
}

.about-closing {
    padding: 80px 20px;
    max-width: 800px;
}

.about-closing blockquote {
    font-size: 22px;
    font-style: italic;
    color: #86868b;
    line-height: 1.6;
    border-left: 4px solid var(--apple-blue);
    padding-left: 24px;
    margin: 0;
}

/* Buy Button */
.btn-buy {
    display: inline-block;
    background-color: var(--apple-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 980px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 400;
    transition: background-color 0.3s;
}

.btn-buy:hover {
    background-color: #0071e3;
}

/* ── Landing Page Styles ────────────────────────────── */
.home-hero {
    padding: 140px 20px 80px;
    text-align: center;
    background: linear-gradient(180deg, #e8ecf4 0%, #f5f5f7 100%);
}

.home-hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.home-hero-portrait {
    margin-bottom: 24px;
}

.home-hero-portrait img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 4px solid white;
}

.home-hero-title {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--apple-text);
}

.home-hero-subtitle {
    font-size: 20px !important;
    color: var(--apple-blue) !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 20px !important;
}

.home-hero-tagline {
    font-size: 18px !important;
    color: #6e6e73 !important;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 32px !important;
}

.home-hero-cta {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    background-color: var(--apple-blue);
    color: white;
    padding: 14px 28px;
    border-radius: 980px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary:hover {
    background-color: #0071e3;
    transform: scale(1.03);
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--apple-blue);
    padding: 14px 28px;
    border-radius: 980px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid var(--apple-blue);
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.btn-secondary:hover {
    background-color: var(--apple-blue);
    color: white;
    transform: scale(1.03);
}

/* Feature Cards */
.home-features {
    padding: 80px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.home-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.home-feature-card {
    display: block;
    background: white;
    border-radius: 18px;
    padding: 36px 30px;
    text-decoration: none;
    color: var(--apple-text);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.home-feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.home-feature-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 16px;
}

.home-feature-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

.home-feature-card p {
    font-size: 15px !important;
    color: #6e6e73 !important;
    line-height: 1.5;
    margin-bottom: 16px !important;
}

.home-feature-link {
    font-size: 14px;
    color: var(--apple-blue);
    font-weight: 500;
}

/* Highlight Banner */
.home-highlight {
    background: linear-gradient(135deg, #1d1d1f 0%, #2c2c2e 100%);
    padding: 80px 20px;
    text-align: center;
}

.home-highlight-inner {
    max-width: 700px;
    margin: 0 auto;
}

.home-highlight h2 {
    color: white;
    font-size: 36px;
}

.home-highlight p {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 18px !important;
    margin-bottom: 28px !important;
}

/* About Snapshot */
.home-about-snapshot {
    padding: 80px 20px;
    text-align: center;
    background: var(--apple-grey);
}

.home-snapshot-content {
    max-width: 650px;
    margin: 0 auto;
}

.home-snapshot-content h2 {
    margin-bottom: 16px;
}

.home-snapshot-content p {
    font-size: 17px !important;
    color: #6e6e73 !important;
    line-height: 1.6;
    margin-bottom: 24px !important;
}

/* ── Site Footer ────────────────────────────────────── */
.site-footer {
    background: #1d1d1f;
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 20px 0;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
    font-size: 20px;
    color: white;
    margin-bottom: 8px;
    font-weight: 600;
}

.footer-brand p {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin: 0 !important;
}

.footer-nav h4,
.footer-connect h4 {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    font-weight: 500;
}

.footer-nav a,
.footer-connect a {
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 6px;
    transition: color 0.2s;
}

.footer-nav a:not(:last-child)::after,
.footer-connect a:not(:last-child)::after {
    content: "|";
    color: rgba(255, 255, 255, 0.3);
    margin-left: 12px;
    pointer-events: none;
}

.footer-nav a:hover,
.footer-connect a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    margin-top: 0;
}

.footer-bottom p {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.3) !important;
    margin: 0 !important;
}

/* ── YouTube Page Styles ────────────────────────────── */
.btn-subscribe {
    display: inline-block;
    background-color: #ff0000;
    color: white;
    padding: 10px 24px;
    border-radius: 980px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-top: 16px;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-subscribe:hover {
    background-color: #cc0000;
    transform: scale(1.03);
}

.yt-channel-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #86868b;
    margin-top: 8px;
}

/* Search */
.yt-search-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px 30px;
    text-align: center;
}

.yt-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.yt-search-wrap input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 980px;
    font-size: 16px;
    font-family: var(--font-family);
    background: var(--apple-grey);
    color: var(--apple-text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.yt-search-wrap input:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.yt-search-btn {
    position: absolute;
    right: 6px;
    background: var(--apple-blue);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.yt-search-btn:hover {
    background-color: #0071e3;
}

.yt-search-clear {
    position: absolute;
    right: 52px;
    background: none;
    border: none;
    color: #86868b;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

.yt-results-label {
    font-size: 14px !important;
    color: var(--apple-blue) !important;
    margin-top: 12px !important;
    font-weight: 500;
}

/* Video Grid */
.yt-section {
    padding: 60px 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.yt-section.bg-grey {
    max-width: 100%;
}

.yt-section h2 {
    text-align: center;
}

.yt-section>p {
    text-align: center;
}

.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 30px;
}

.yt-card {
    border-radius: 14px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

a.yt-static-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.yt-static-card .yt-title {
    color: #1d1d1f;
}

a.yt-static-card:hover .yt-title {
    color: var(--apple-blue);
}

.yt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.yt-thumb {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
}

.yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.yt-card:hover .yt-thumb img {
    transform: scale(1.05);
}

.yt-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.yt-info {
    padding: 14px 16px;
}

.yt-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-title:hover {
    color: var(--apple-blue);
}

.yt-meta {
    font-size: 13px !important;
    color: #86868b !important;
    margin: 0 !important;
}

.yt-loading,
.yt-empty {
    text-align: center;
    grid-column: 1 / -1;
    color: #86868b !important;
    font-size: 16px !important;
}

/* Shorts Row */
.yt-shorts-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 30px 0 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-width: 1300px;
    margin: 0 auto;
}

.yt-shorts-row::-webkit-scrollbar {
    height: 6px;
}

.yt-shorts-row::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.yt-short-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
}

.yt-short-card .yt-thumb {
    aspect-ratio: 9/16;
    border-radius: 14px;
}

.yt-short-card .yt-info {
    padding: 8px 4px;
}

.yt-short-card .yt-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
}

.yt-short-card .yt-meta {
    font-size: 11px !important;
}

/* Featured Playlist Embed */
.yt-playlist-embed {
    max-width: 900px;
    margin: 30px auto 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.yt-playlist-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
}

/* Video Modal */
.yt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.yt-modal.active {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 2001;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    border-radius: 14px;
    overflow: hidden;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
}

/* Responsive — Tablet */
@media (max-width: 1024px) {
    h1 {
        font-size: 44px;
    }

    h2 {
        font-size: 34px;
    }

    p {
        font-size: 18px;
    }

    section {
        padding: 80px 20px;
    }

    nav a {
        margin: 0 12px;
        font-size: 11px;
    }

    /* Landing page tablet */
    .home-hero-title {
        font-size: 42px;
    }

    .home-features-grid {
        grid-template-columns: 1fr;
    }

    .home-highlight h2 {
        font-size: 28px;
    }
}

/* Responsive — Smartphone */
@media (max-width: 768px) {
    nav {
        height: 44px;
        justify-content: center;
        padding: 0;
    }

    .nav-toggle-label {
        display: block;
    }

    /* Hamburger open icon */
    .nav-toggle-label .menu-icon {
        display: inline;
    }

    .nav-toggle-label .close-icon {
        display: none;
    }

    .nav-toggle:checked~.nav-toggle-label .menu-icon {
        display: none;
    }

    .nav-toggle:checked~.nav-toggle-label .close-icon {
        display: inline;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 44px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: saturate(180%) blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding: 12px 0;
    }

    .nav-toggle:checked~.nav-links {
        display: flex;
    }

    nav a {
        margin: 8px 0;
        font-size: 14px;
        text-align: center;
        padding: 6px 20px;
    }

    header[style] {
        padding-top: 100px !important;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    p {
        font-size: 17px;
        margin: 0 auto 20px;
    }

    section {
        padding: 60px 16px;
    }

    #writings {
        flex-direction: column;
        gap: 20px;
    }

    .writing-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding-bottom: 20px;
        padding-right: 0;
    }

    .about-profile {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .about-intro h2 {
        text-align: center;
    }

    .about-intro p,
    .about-card p {
        text-align: left;
    }

    .about-portrait img {
        width: 180px;
        height: 180px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-closing blockquote {
        font-size: 18px;
    }

    .yt-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .yt-short-card {
        flex: 0 0 150px;
    }

    .yt-section {
        padding: 40px 16px;
    }

    .modal-content {
        width: 95%;
    }

    /* Footer mobile override to keep links inline */
    .footer-nav a,
    .footer-connect a {
        display: inline-block;
        padding: 4px 6px;
        margin: 0;
    }

    /* Landing page smartphone */
    .home-hero {
        padding: 100px 16px 50px;
    }

    .home-hero-portrait img {
        width: 120px;
        height: 120px;
    }

    .home-hero-title {
        font-size: 34px;
    }

    .home-hero-tagline {
        font-size: 16px !important;
    }

    .home-features {
        padding: 50px 16px;
    }

    .home-highlight {
        padding: 50px 16px;
    }

    .home-about-snapshot {
        padding: 50px 16px;
    }
}

/* Responsive — Small Phone */
@media (max-width: 480px) {
    nav a {
        margin: 3px 6px;
        font-size: 11px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    p {
        font-size: 16px;
    }

    section {
        padding: 50px 12px;
    }

    header[style] {
        padding-top: 100px !important;
    }

    .btn-buy {
        padding: 10px 20px;
        font-size: 15px;
    }

    .about-portrait img {
        width: 150px;
        height: 150px;
    }

    .about-closing blockquote {
        font-size: 16px;
        padding-left: 16px;
    }

    .yt-search-wrap input {
        font-size: 14px;
        padding: 12px 48px 12px 16px;
    }

    .yt-grid {
        grid-template-columns: 1fr;
    }

    .yt-short-card {
        flex: 0 0 130px;
    }

    /* Landing page small phone */
    .home-hero {
        padding: 90px 12px 40px;
    }

    .home-hero-title {
        font-size: 28px;
    }

    .home-hero-subtitle {
        font-size: 16px !important;
    }

    .home-hero-tagline {
        font-size: 14px !important;
    }

    .home-hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .home-feature-card {
        padding: 24px 20px;
    }

    .home-highlight h2 {
        font-size: 24px;
    }

    .home-highlight p {
        font-size: 15px !important;
    }

    .site-footer {
        padding: 40px 12px 0;
    }
}