/* -----------------------------------------------------------
   1. FONTS & VARIABLES
   ----------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Inter:wght@400;600&display=swap');

:root {
    --ink: rgb(44, 62, 80);
    --paper-color: rgb(254, 249, 199);
    --paper-line: rgba(68, 166, 198, 0.3); /* Blueish line */
    --paper-margin: rgba(255, 0, 100, 0.3); /* Pink margin */
    --wire-grey: rgb(45, 45, 45);
    --line-height: 32px; /* Magic number for vertical rhythm */
    --line-color: #949494;
}

/* -----------------------------------------------------------
   2. GLOBAL LAYOUT
   ----------------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(232, 232, 232);
    background-image: url('table.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    font-family: 'Kalam', cursive;
    color: var(--ink);
    overflow: hidden;
}

/* -----------------------------------------------------------
   3. NOTEPAD CONTAINER
   ----------------------------------------------------------- */
.notepad-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 90vh;
    max-height: 900px;
    filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.2));
}

/* -----------------------------------------------------------
   4. PAGES & STACK
   ----------------------------------------------------------- */
.notepad-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Simple page stacking - no 3D */
.notepad-stack::before,
.notepad-stack::after {
    content: '';
    position: absolute;
    left: 3px;
    right: -3px;
    height: 100%;
    background-color: var(--paper-color);
    border-radius: 2px 5px 5px 2px;
    z-index: -1;
}

.notepad-stack::before {
    top: 3px;
    filter: brightness(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notepad-stack::after {
    top: 6px;
    filter: brightness(0.92);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--paper-color);
    padding: 0 60px 60px 90px;
    
    /* Notebook Paper Lines */
    background-image:
        linear-gradient(transparent 31px, var(--line-color) 31px),
        linear-gradient(90deg, var(--paper-margin) 1px, transparent 1px);
    background-size: 100% var(--line-height), 100% 100%;
    background-position: 0 0, 70px 0;
    background-attachment: local;
    
    border-radius: 2px 5px 5px 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    
    /* Simple fade transition */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    overflow: hidden;
}

/* Active Page (Top of stack) */
.page.active {
    z-index: 100;
    opacity: 1;
    visibility: visible;
}

/* Next Page (Behind active) */
.page.next {
    z-index: 99;
    opacity: 0;
    visibility: hidden;
}

/* Flipped Page (Turned over) */
.page.flipped {
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Hidden/Future pages */
.page.hidden {
    z-index: 0;
    opacity: 0;
    visibility: hidden;
}

/* -----------------------------------------------------------
   6. CONTENT STYLING - VERTICAL RHYTHM SYSTEM
   ----------------------------------------------------------- */

/* Reset all margins to 0 first */
p, h1, h2, h3, div, ul {
    margin: 0;
    padding: 0;
}

.page-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.page-number {
    position: absolute;
    top: 0;
    right: 30px;
    font-size: 14px;
    color: rgba(0,0,0,0.4);
    line-height: var(--line-height); /* 32px */
    height: var(--line-height);
    display: flex;
    align-items: center;
}

.note-date {
    font-family: 'Kalam', cursive;
    color: rgb(5, 150, 105);
    font-size: 15.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    margin-top: var(--line-height); /* Push down 1 line */
    margin-bottom: 0;
    text-decoration: underline;
}

.note-subject {
    font-family: 'Kalam', cursive;
    color: rgb(124, 58, 237);
    font-size: 20.8px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    margin-bottom: 0;
    font-style: italic;
    text-align: center;
}

.title-with-image {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: var(--line-height); /* 32px */
    height: auto;
    margin-bottom: var(--line-height);
}

.profile-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

h1 {
    font-family: 'Kalam', cursive;
    font-size: 52px;
    color: #2563eb;
    font-weight: 700;
    line-height: 64px;
    margin: 0;
}

h2 {
    font-size: 2rem;
    color: rgb(90, 50, 255);
    text-decoration: underline;
    text-decoration-color: rgba(90, 50, 255, 0.3);
    line-height: var(--line-height); /* 32px */
    margin-top: var(--line-height);
    margin-bottom: var(--line-height);
}

h3 {
    font-family: 'Kalam', cursive;
    font-size: 20px;
    color: #444;
    line-height: var(--line-height); /* 32px */
    margin-bottom: 0;
}

.tagline {
    font-family: 'Kalam', cursive;
    font-size: 25.6px;
    color: rgb(220, 38, 38);
    line-height: var(--line-height); /* 32px - CRITICAL */
    margin-bottom: var(--line-height); /* Empty line after */
    font-weight: 700;
}

.intro, .philosophy, .credibility, .center-gravity {
    font-size: 19.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    color: #333;
    margin-bottom: var(--line-height); /* Empty line between paragraphs */
}

.philosophy {
    font-style: italic;
    color: #555;
}

/* Work principles styling */
.work-principle-first {
    font-size: 19.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    color: rgb(220, 38, 38); /* Orange/red like in original */
    font-style: italic;
    margin-bottom: var(--line-height);
}

.work-principle {
    font-size: 19.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    color: rgb(44, 62, 80); /* Dark blue/gray */
    font-style: italic;
    margin-bottom: var(--line-height);
}

.credibility {
    color: rgb(44, 62, 80);
    font-size: 19.2px;
    line-height: var(--line-height);
    font-weight: bold;
    margin-top: auto;
    margin-bottom: var(--line-height);
}

ul.skills {
    list-style-type: disc;
    padding-left: 20px;
    font-size: 19.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    margin-bottom: var(--line-height);
}

ul.skills li {
    margin-bottom: 0;
}

.project {
    margin-bottom: var(--line-height);
}

.project h3 {
    margin-bottom: 0;
    color: #00897B;
    font-size: 20px;
    line-height: var(--line-height);
}

.project p {
    font-size: 19.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    color: #444;
    margin-bottom: 0;
    font-style: italic;
}

.project-link {
    font-size: 19.2px;
    line-height: var(--line-height);
    margin-top: 0;
}

.project-link a {
    color: rgb(37, 99, 235);
    text-decoration: none;
    font-weight: 600;
}

.project-link a:hover {
    text-decoration: underline;
}

.stack-section {
    margin-bottom: var(--line-height);
}

.stack-section h3 {
    font-size: 20px;
    line-height: var(--line-height);
    margin-bottom: 0;
    color: #00897B;
}

.stack-section p {
    font-size: 19.2px;
    line-height: var(--line-height); /* 32px - CRITICAL */
    color: #444;
    margin-bottom: 0;
    font-style: italic;
}

.tools {
    font-family: 'Kalam', cursive; /* Use handwriting font for consistency */
    font-size: 19.2px;
    line-height: var(--line-height);
    color: rgb(37, 99, 235); /* Blue color like in original */
}

.tools strong {
    color: rgb(37, 99, 235); /* Blue color for labels */
    font-weight: 600;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--line-height);
    font-size: 19.2px;
    line-height: var(--line-height);
}

.contact-link .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-link .icon svg {
    width: 20px;
    height: 20px;
    fill: #667eea;
}

.contact-link a {
    color: rgb(37, 99, 235);
    text-decoration: none;
    font-weight: 600;
}

.contact-link a:hover {
    text-decoration: underline;
}

.next-page-link {
    text-align: right;
    margin-top: auto;
    color: rgb(37, 99, 235);
    cursor: pointer;
    text-decoration: underline;
    font-size: 19.2px;
    line-height: var(--line-height);
    margin-bottom: 0;
    user-select: none;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.3);
}

.next-page-link:hover,
.next-page-link:active {
    color: rgb(29, 78, 216);
}

.prev-page-link {
    text-align: left;
    color: rgb(37, 99, 235);
    cursor: pointer;
    text-decoration: underline;
    font-size: 19.2px;
    line-height: var(--line-height);
    margin-bottom: var(--line-height);
    user-select: none;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.3);
}

.prev-page-link:hover,
.prev-page-link:active {
    color: rgb(29, 78, 216);
}

/* -----------------------------------------------------------
   7. NAVIGATION ARROWS
   ----------------------------------------------------------- */
.nav-arrow {
    display: none;
}

.nav-hint {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.nav-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Long Content Pages */
.page.long-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Make pages scrollable on mobile when content overflows */
@media (max-width: 768px) {
    .page {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* -----------------------------------------------------------
   8. CUSTOM SCROLLBAR
   ----------------------------------------------------------- */
.page::-webkit-scrollbar {
    width: 12px;
}

.page::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 10px 0;
}

.page::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid var(--paper-color);
}

.page::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar */
.page {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

/* Clock and Graph removed for performance */

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --line-height: 32px; /* Keep same line height as desktop */
    }
    
    body {
        padding: 10px;
    }
    
    .notepad-container {
        max-width: 100%;
        height: 85vh;
    }
    
    .page {
        padding: 32px 30px 30px 50px; /* Top padding = line-height for alignment */
        overflow-y: auto; /* Enable scrolling on all pages for mobile */
        -webkit-overflow-scrolling: touch;
        /* Keep same background lines as desktop */
        background-image:
            linear-gradient(transparent 31px, var(--line-color) 31px),
            linear-gradient(90deg, var(--paper-margin) 1px, transparent 1px);
        background-size: 100% var(--line-height), 100% 100%;
        background-position: 0 0, 50px 0;
    }
    
    /* Remove the specific page 5 override since all pages are now scrollable */
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    h1 {
        font-size: 32px;
        line-height: 64px; /* 2 lines */
    }
    
    h2 {
        font-size: 22px;
        line-height: var(--line-height);
    }
    
    h3 {
        font-size: 17px;
        line-height: var(--line-height);
    }
    
    .profile-image {
        width: 60px;
        height: 60px;
    }
    
    .tagline {
        font-size: 18px;
        line-height: var(--line-height);
    }
    
    .intro, .philosophy, .credibility, .center-gravity,
    .work-principle-first, .work-principle {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    ul.skills {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    .project p, .project-link {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    .stack-section p, .tools {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    .contact-link {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    .next-page-link {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    .prev-page-link {
        font-size: 15px;
        line-height: var(--line-height);
    }
    
    .note-date {
        font-size: 13px;
        line-height: var(--line-height);
    }
    
    .note-subject {
        font-size: 17px;
        line-height: var(--line-height);
    }
    

}

@media (max-width: 480px) {
    :root {
        --line-height: 32px; /* Keep same line height as desktop */
    }
    
    .page {
        padding: 32px 25px 20px 45px; /* Top padding = line-height for alignment */
        overflow-y: auto; /* Enable scrolling on all pages for small phones */
        -webkit-overflow-scrolling: touch;
        /* Keep same background lines as desktop */
        background-image:
            linear-gradient(transparent 31px, var(--line-color) 31px),
            linear-gradient(90deg, var(--paper-margin) 1px, transparent 1px);
        background-size: 100% var(--line-height), 100% 100%;
        background-position: 0 0, 45px 0;
    }
    
    .nav-arrow.left {
        left: 10px;
    }
    
    .nav-arrow.right {
        right: 10px;
    }
    
    h1 {
        font-size: 26px;
        line-height: 64px; /* 2 lines */
    }
    
    h2 {
        font-size: 20px;
        line-height: var(--line-height);
    }
    
    h3 {
        font-size: 16px;
        line-height: var(--line-height);
    }
    
    .tagline {
        font-size: 17px;
        line-height: var(--line-height);
    }
    
    .intro, .philosophy, .credibility, .center-gravity,
    .work-principle-first, .work-principle {
        font-size: 14px;
        line-height: var(--line-height);
    }
    
    ul.skills {
        font-size: 14px;
        line-height: var(--line-height);
        padding-left: 18px;
    }
    
    .project p, .project-link {
        font-size: 14px;
        line-height: var(--line-height);
    }
    
    .stack-section p, .tools {
        font-size: 14px;
        line-height: var(--line-height);
    }
    
    .contact-link {
        font-size: 14px;
        line-height: var(--line-height);
    }
    
    .next-page-link {
        font-size: 14px;
        line-height: var(--line-height);
    }
    
    .prev-page-link {
        font-size: 14px;
        line-height: var(--line-height);
    }
    
    .note-date {
        font-size: 12px;
        line-height: var(--line-height);
    }
    
    .note-subject {
        font-size: 16px;
        line-height: var(--line-height);
    }
    
    .title-with-image {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .profile-image {
        width: 50px;
        height: 50px;
    }
    

}
