/* ===================================
   VARIABLES & RESET
   =================================== */

:root {
    --paper: #FDFBF7;
    --charcoal: #1A1A1A;
    --black: #000000;
    --white: #FFFFFF;
    --grid-line: #1A1A1A;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--charcoal);
    background-color: var(--paper);
    overflow-x: hidden;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

/* Enforce 2-Font Rule: Serif for H1/H2 only, Sans for everything else */
h1, h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
}

h3, h4, h5, h6 {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-weight: 700;
}

h1 {
    font-size: clamp(4rem, 12vw, 12rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
}

h2 {
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.2;
    letter-spacing: 0;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

p {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.8;
}

.label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ===================================
   NAVIGATION
   =================================== */

.top-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3%;
    height: 6rem;
    background-color: var(--paper);
    border-bottom: 1px solid var(--grid-line);
    z-index: 1000;
}

.nav-logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    color: var(--charcoal);
    text-decoration: none;
    letter-spacing: -0.02em;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--charcoal);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.2s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--charcoal);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 25px;
    height: 1px;
    background-color: var(--charcoal);
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* ===================================
   HERO SECTION - STICKY SPLIT LAYOUT
   =================================== */

.hero {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-bottom: 1px solid var(--grid-line);
}

.hero-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0;
    width: 100%;
    align-items: stretch;
}

.hero-left {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem;
    border-right: 1px solid var(--grid-line);
    overflow: hidden;
}

.hero-name {
    font-size: clamp(4rem, 8vw, 10rem);
    color: var(--charcoal);
    line-height: 0.85;
    letter-spacing: -0.05em;
    font-weight: 400;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    margin-top: auto;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.hero-image:hover {
    filter: grayscale(0%);
}

.hero-middle {
    display: none;
}

.hero-right {
    display: flex;
    flex-direction: column;
    padding: 3rem;
    gap: 2rem;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--charcoal);
    margin-bottom: 2rem;
}

.hero-intro {
    color: var(--charcoal);
    font-size: 1.125rem;
    line-height: 1.8;
}

.focus-areas {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--grid-line);
}

.focus-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.focus-list li {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    line-height: 1.4;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--charcoal);
}

.currently-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--grid-line);
}

/* ===================================
   INNER PAGE LAYOUTS - STICKY SPLIT
   =================================== */

.page-hero {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-bottom: 1px solid var(--grid-line);
}

.page-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0;
    width: 100%;
    align-items: start;
}

.page-left {
    position: sticky;
    top: 6rem;
    height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem;
    border-right: 1px solid var(--grid-line);
}

.page-middle {
    display: none;
}

.page-title {
    font-size: clamp(4rem, 8vw, 10rem);
    color: var(--charcoal);
    line-height: 0.85;
    letter-spacing: -0.05em;
}

.page-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--black);
    margin-bottom: 2rem;
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem;
}

.page-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--charcoal);
}

.page-content h3 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.topic-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-list li {
    padding-left: 2rem;
    position: relative;
    color: var(--charcoal);
    font-size: 1rem;
    line-height: 1.6;
}

.topic-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--charcoal);
}

.cta-text {
    margin-top: 2rem;
    font-weight: 500;
}

.page-cta {
    display: inline-block;
    padding: 1.25rem 3rem;
    background-color: transparent;
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid var(--charcoal);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    transition: all 0.15s ease;
}

.page-cta:hover {
    background-color: var(--charcoal);
    color: var(--white);
}

.page-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: #E8E8E8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.speaking-images {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
    margin: 3rem 0;
    padding: 0;
}

.speaking-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.5s ease;
    display: block;
}

.speaking-image:hover {
    filter: grayscale(0%);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.contact-item h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.contact-link {
    color: var(--charcoal);
    text-decoration: none;
    font-size: 1.125rem;
    transition: all 0.15s ease;
    display: inline-block;
    border-bottom: 1px solid var(--charcoal);
    padding-bottom: 2px;
}

.contact-link:hover {
    background-color: var(--charcoal);
    color: var(--white);
    border-bottom-color: var(--charcoal);
}

.talk-item {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--grid-line);
}

.talk-item:first-of-type {
    margin-top: 2rem;
}

.talk-item h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--black);
}

.talk-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.talk-detail {
    color: var(--charcoal);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.talk-link {
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--charcoal);
    padding-bottom: 2px;
    display: inline-block;
}

.talk-link:hover {
    background-color: var(--charcoal);
    color: var(--white);
}

.video-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.video-list li {
    padding-left: 0;
}

.video-list a {
    color: var(--charcoal);
    text-decoration: none;
    transition: all 0.15s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.video-list a:hover {
    background-color: var(--charcoal);
    color: var(--white);
    border-bottom-color: var(--charcoal);
}

/* ===================================
   CONTACT GRID
   =================================== */

.contact-grid-section {
    min-height: 100vh;
    padding: 3rem 3% 4rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.contact-grid-container {
    max-width: 100%;
}

.contact-main-title {
    font-size: clamp(4rem, 8vw, 10rem);
    color: var(--charcoal);
    line-height: 0.85;
    letter-spacing: -0.05em;
    margin-bottom: 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background-color: var(--grid-line);
    border: 1px solid var(--grid-line);
}

.contact-module {
    aspect-ratio: 1;
    background-color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.contact-module:hover {
    background-color: var(--charcoal);
}

.module-inner {
    text-align: center;
}

.module-title {
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--charcoal);
    margin-bottom: 1rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.contact-module:hover .module-title {
    color: var(--white);
}

.module-text {
    font-size: 0.875rem;
    color: var(--charcoal);
    transition: color 0.15s ease;
}

.contact-module:hover .module-text {
    color: var(--white);
}

.contact-module-info {
    background-color: var(--charcoal);
    cursor: default;
}

.contact-module-info:hover {
    background-color: var(--charcoal);
}

.module-info-text {
    font-size: 1rem;
    color: var(--white);
    line-height: 1.6;
}

/* ===================================
   SECTIONS
   =================================== */

.section {
    padding: 7rem 3%;
    border-bottom: 1px solid var(--grid-line);
}

.container {
    max-width: 100%;
}

.section-title {
    margin-bottom: 4rem;
    color: var(--charcoal);
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
}

/* ===================================
   EXPERIENCE SECTION
   =================================== */

.experience {
    background-color: var(--paper);
}

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

.experience-item {
    padding: 3rem 0;
    background-color: transparent;
    border-bottom: 1px solid var(--grid-line);
    transition: all 0.2s ease;
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-item:hover {
    background-color: var(--charcoal);
    color: var(--white);
    padding-left: 2rem;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.experience-title {
    color: inherit;
    font-size: 2rem;
    font-weight: 400;
}

.experience-company {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.experience-location {
    opacity: 0.7;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.experience-description {
    color: inherit;
    margin-top: 1rem;
    line-height: 1.8;
    max-width: 900px;
}

/* ===================================
   WRITING SECTION
   =================================== */

.writing {
    background-color: var(--paper);
}

.writing-intro {
    font-size: 1.125rem;
    color: var(--charcoal);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 800px;
}

.writing-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.writing-link {
    color: var(--charcoal);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--charcoal);
    padding-bottom: 4px;
}

.writing-link:hover {
    background-color: var(--charcoal);
    color: var(--white);
}

/* ===================================
   CONTACT SECTION
   =================================== */

.contact {
    background-color: var(--charcoal);
    text-align: center;
    color: var(--white);
    border-bottom: none;
}

.contact .section-title {
    color: var(--white);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-text {
    margin-bottom: 3rem;
    font-size: 1.125rem;
    color: var(--white);
    opacity: 0.9;
}

.social-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 1.25rem 3rem;
    background-color: transparent;
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid var(--white);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    transition: all 0.15s ease;
}

.social-link:hover {
    background-color: var(--white);
    color: var(--charcoal);
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    background-color: var(--charcoal);
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem 3%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
    }

    .hero-left {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--grid-line);
        padding: 3rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        overflow: visible;
    }

    .hero-image {
        order: 2;
        margin-top: 0;
        height: auto;
        aspect-ratio: 3/4;
    }

    .hero-name {
        order: 1;
    }

    .hero-middle {
        display: none;
    }

    .hero-right {
        padding: 3rem;
    }

    .page-container {
        grid-template-columns: 1fr;
    }

    .page-left {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--grid-line);
        padding: 3rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .page-title {
        order: 1;
    }

    .page-left .hero-image {
        order: 2;
        margin-top: 0;
    }

    .page-middle {
        display: none;
    }

    .page-content {
        padding: 3rem;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--paper);
        flex-direction: column;
        padding: 6rem 2rem;
        gap: 2rem;
        border-left: 1px solid var(--grid-line);
        transition: right 0.4s ease;
    }

    .nav-menu.active {
        right: 0;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

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

    .contact-grid-section {
        padding: 3rem 3% 3rem;
    }

    .hero {
        padding: 6rem 3% 3rem;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 1.5rem 3%;
    }

    .section {
        padding: 4rem 3%;
    }

    .hero-name {
        font-size: clamp(3.5rem, 15vw, 6rem);
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

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

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.15s ease;
}

/* ===================================
   TOKEN MODE EASTER EGG
   =================================== */

/* Token Mode Loading State - Prevents FOUC */
html.token-mode-loading,
html.token-mode-loading body {
    background-color: #0a0a0a !important;
    color: #00ff00 !important;
}

html.token-mode-loading * {
    font-family: 'Courier New', 'Fira Code', 'Monaco', 'Consolas', monospace !important;
    visibility: hidden; /* Hide until tokenization complete */
}

html.token-mode-loading .top-nav,
html.token-mode-loading #token-counter {
    visibility: visible; /* Keep nav visible */
}

/* Token Mode Active State */
body.token-mode {
    font-family: 'Courier New', 'Fira Code', 'Monaco', 'Consolas', monospace !important;
    background-color: #0a0a0a;
    color: #00ff00;
}

body.token-mode * {
    font-family: 'Courier New', 'Fira Code', 'Monaco', 'Consolas', monospace !important;
    visibility: visible; /* Restore visibility after tokenization */
}

/* Token Styling */
body.token-mode .token {
    display: inline-block;
    padding: 2px 4px;
    margin: 1px;
    border-radius: 3px;
    font-size: inherit;
    line-height: inherit;
    transition: all 0.2s ease;
}

body.token-mode .token:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Token Color Classes - OpenAI Style */
body.token-mode .token-1 {
    background-color: #e0f2fe;
    color: #0c4a6e;
}

body.token-mode .token-2 {
    background-color: #dcfce7;
    color: #14532d;
}

body.token-mode .token-3 {
    background-color: #fce7f3;
    color: #831843;
}

body.token-mode .token-4 {
    background-color: #fef3c7;
    color: #78350f;
}

body.token-mode .token-5 {
    background-color: #e0e7ff;
    color: #312e81;
}

/* Token Counter HUD */
#token-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #000000;
    color: #00ff00;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    z-index: 10000;
    min-width: 220px;
    animation: slideInUp 0.3s ease-out;
}

#token-counter .token-counter-line {
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

#token-counter .token-count-num,
#token-counter .token-cost-num {
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#token-counter .token-counter-hint {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #00ff00;
    font-size: 11px;
    opacity: 0.7;
    text-align: center;
}

/* Override background in token mode */
body.token-mode .hero,
body.token-mode .page-hero,
body.token-mode .contact-grid-section {
    background-color: #0a0a0a;
}

body.token-mode .top-nav {
    background-color: #000000;
    border-bottom: 1px solid #00ff00;
}

body.token-mode .hero-left,
body.token-mode .page-left {
    border-right: 1px solid #00ff00;
}

body.token-mode .hero-image,
body.token-mode img {
    filter: grayscale(100%) brightness(0.3) contrast(1.5);
    border: 1px solid #00ff00;
}

/* Slide in animation for counter */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
