/* ==========================================================================
   MUHAMMED THAMEEM M Y - Retro Minimalist Stylesheet
   Inspired by: https://nadh.in/
   Aesthetics: Elegant serif typography (EB Garamond), light-gray borders,
               crisp orange accents, clean slideshow, paper console terminal
   ========================================================================== */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-size: 21px; /* Slightly scaled down from nadh's 23px for better layout readability */
}

body {
    background: #f6f6f6;
    font-family: "EB Garamond", Georgia, serif;
    color: #333;
    line-height: 1.6rem;
    font-weight: 400;
    min-width: 325px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #ff3300;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #000;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ddd;
    margin: 40px 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3em;
    margin: 45px 0 20px 0;
    color: #111;
}

h1 { font-size: 2.0rem; }
h2 { font-size: 1.5rem; border-bottom: 1px solid #eee; padding-bottom: 8px; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p {
    margin: 0 0 15px 0;
}

p:last-child {
    margin-bottom: 0;
}

ul {
    margin: 0 0 20px 0;
    padding-left: 25px;
}

li {
    margin-bottom: 8px;
}

blockquote {
    background: #fcfcfc;
    font-style: italic;
    border-left: 4px solid #ff3300;
    padding: 10px 20px;
    margin: 25px 0;
}

blockquote p {
    margin-bottom: 0;
}

code {
    display: inline-block;
    background: #f4f4f4;
    color: #cc0000;
    padding: 1px 5px;
    font-size: 0.775em;
    line-height: 1.2em;
    border-radius: 4px;
    font-family: "JetBrains Mono", "Courier New", monospace;
}

pre {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    margin: 20px 0;
}

pre code {
    display: block;
    background: transparent;
    color: #333;
    padding: 0;
    font-size: 0.8em;
}

.text-small {
    font-size: 0.85rem;
    color: #777;
}

.half {
    max-width: 75%;
}

/* Page Layout Structure */
.container {
    max-width: 1100px;
    min-width: 320px;
}

.wrap {
    background: #fff;
    margin: 0 auto;
    padding: 80px 100px;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    box-shadow: 0 0 15px rgba(0,0,0,0.02);
}

/* Header */
.header {
    margin-bottom: 80px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.header .logo, .header .nav {
    flex-grow: 1;
}

.header .logo a {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
    font-family: "EB Garamond", Georgia, serif;
    letter-spacing: -0.5px;
}

.header .logo a span {
    color: #ff3300;
}

.header .nav {
    text-align: right;
}

.header .nav a {
    display: inline-block;
    margin-left: 25px;
    font-size: 0.95rem;
    color: #666;
}

.header .nav a:hover {
    color: #000;
}

.header .nav a.active {
    color: #ff3300;
    font-weight: 600;
}

/* Slogan */
.slogan {
    margin: 0 0 50px 0;
    font-style: italic;
    font-size: 1.45rem;
    color: #444;
    border-bottom: 2px solid #ff3300;
    padding-bottom: 15px;
    display: inline-block;
}

/* Author Photo */
.photo {
    float: right;
    text-align: right;
    margin-left: 30px;
    margin-bottom: 20px;
}

.photo img {
    border-radius: 100%;
    display: inline-block;
    max-width: 220px;
    height: auto;
    border: 1px solid #e0e0e0;
    background: #fff;
    padding: 4px;
}

/* Slideshow */
.slideshow {
    margin: 40px -100px;
    position: relative;
    background: #fcfcfc;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.slideshow figure {
    position: relative;
    overflow: hidden;
    height: 0;
    opacity: 0;
    margin: 0;
    transition: height 0ms 2000ms, opacity 2000ms 0ms;
}

.slideshow figure.visible {
    height: auto;
    opacity: 1;
    transition: height 0ms 0ms, opacity 2100ms 0ms;
}

.slideshow figure img {
    display: block;
    width: 100%;
    height: 380px;
    object-fit: cover;
}

.slideshow figure figcaption {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 3px;
    font-family: sans-serif;
}

/* Skills list layout */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 30px 0;
}

.skills-category {
    flex: 1;
    min-width: 280px;
}

.skills-category h3 {
    margin-top: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skills-tags span {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    color: #444;
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-family: "JetBrains Mono", Courier, monospace;
}

/* Projects list layout */
.projects {
    margin-top: 40px;
    padding: 0;
    list-style: none;
}

.projects li {
    margin-bottom: 45px;
    padding-bottom: 30px;
    border-bottom: 1px dashed #eee;
}

.projects li:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.projects h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
}

.projects h3 a {
    color: #ff3300;
    border-bottom: 1px solid #ffd0c0;
    padding-bottom: 2px;
}

.projects h3 a:hover {
    color: #000;
    border-color: #000;
}

.projects h3 a span {
    color: #999;
    font-size: 0.8em;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: normal;
}

.projects .desc p {
    margin: 15px 0;
    color: #444;
}

.projects .status {
    display: inline-block;
    color: #777;
    font-size: 0.8rem;
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-family: "JetBrains Mono", Courier, monospace;
}

.projects .project-bullets {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #555;
    padding-left: 20px;
}

.projects .project-bullets li {
    margin-bottom: 6px;
    padding-bottom: 0;
    border: 0;
    list-style: square;
}

.project-demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-family: "JetBrains Mono", monospace;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.15s ease;
}

.project-demo-btn:hover {
    background: #ff3300;
    border-color: #ff3300;
}

/* Timeline (Education) */
.timeline {
    margin: 30px 0;
    padding-left: 10px;
}

.timeline-item {
    margin-bottom: 30px;
    border-left: 2px solid #ff3300;
    padding-left: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ff3300;
}

.timeline-date {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    color: #777;
    display: block;
    margin-bottom: 5px;
}

.timeline-degree {
    margin: 5px 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.timeline-inst {
    font-size: 0.95rem;
    color: #ff3300;
    margin-bottom: 10px;
}

/* Paper Console Terminal Simulator */
.terminal-emulator {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    color: #333;
    padding: 20px;
    margin: 30px 0;
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.terminal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-title {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
}

.terminal-status {
    font-size: 0.7rem;
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.terminal-body {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
}

.terminal-line {
    margin-bottom: 6px;
    white-space: pre-wrap;
    font-family: inherit;
}

.user-cmd {
    color: #ff3300;
    font-weight: 600;
}

.system-msg {
    color: #555;
}

.error-msg {
    color: #c62828;
}

.terminal-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.75rem;
    align-items: center;
}

.sugg-label {
    color: #888;
    font-weight: 500;
}

.terminal-suggestions button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
    font-family: inherit;
    transition: all 0.15s ease;
}

.terminal-suggestions button:hover {
    background: #ff3300;
    border-color: #ff3300;
    color: #fff;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-prompt {
    color: #666;
    font-weight: 600;
}

#terminal-form {
    flex-grow: 1;
    display: flex;
    margin: 0;
    padding: 0;
}

#terminal-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    padding: 0;
    width: 100%;
}

/* Footer */
.footer {
    text-align: center;
    color: #999;
    margin: 60px 0 30px 0;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.footer a {
    color: #666;
    text-decoration: underline;
}

.footer a:hover {
    color: #ff3300;
}

/* Media Queries for Responsive Design */
@media screen and (min-width: 1800px) {
    body {
        font-size: 23px;
        line-height: 1.65;
    }
    .container {
        max-width: 1250px;
    }
}

@media (max-width: 992px) {
    body {
        font-size: 19px;
        line-height: 1.5;
    }

    .wrap {
        padding: 40px 30px;
    }

    .header {
        display: block;
        text-align: center;
        margin-bottom: 40px;
    }

    .header .logo {
        margin-bottom: 20px;
    }

    .header .nav {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .header .nav a {
        margin: 0;
        font-size: 0.85rem;
    }

    .slogan {
        text-align: center;
        display: block;
        margin-bottom: 40px;
    }

    .photo {
        float: none;
        text-align: center;
        margin-left: 0;
        margin-bottom: 30px;
    }

    .photo img {
        max-width: 180px;
    }

    .slideshow {
        margin: 30px -30px;
    }
    
    .slideshow figure img {
        height: 250px;
    }

    .half {
        max-width: none;
    }

    .skills-container {
        flex-direction: column;
        gap: 20px;
    }
}
