/* ==========================================================================
   Design System — Tech Utility
   Craft rules: Open Design (color.md, typography.md, anti-ai-slop.md,
   animation-discipline.md)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties (semantic naming — never by hue)
   -------------------------------------------------------------------------- */
:root {
    /* Neutrals — 70-90% of pixels */
    --bg:        #0a0a0a;
    --bg-raised: #111113;
    --surface:   #18181b;
    --fg:        #d4d4d4;
    --fg-dim:    #9a9a9a;
    --muted:     #6b6b6b;
    --border:    rgba(255, 255, 255, 0.07);

    /* Accent — exactly ONE, used at most twice per screen */
    --accent:       #00e05a;
    --accent-dim:   #00b348;

    /* Semantic — 0-5% of pixels */
    --success: #00cc66;
    --warn:    #e6a817;
    --danger:  #e04444;

    /* Typography */
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'SF Mono',
                 'Consolas', 'Courier New', monospace;
    --font-sans: 'Inter', 'SF Pro Display', system-ui, -apple-system,
                 'Segoe UI', sans-serif;

    /* Type scale (multiplicative 1.25) */
    --text-display: clamp(2.5rem, 5vw, 3.75rem);   /* 48-60px */
    --text-h1:      clamp(1.75rem, 4vw, 2.5rem);    /* 32-40px */
    --text-h2:      1.5rem;                           /* 24px */
    --text-h3:      1.25rem;                          /* 20px */
    --text-body:    1rem;                             /* 16px */
    --text-small:   0.8125rem;                        /* 13px */
    --text-caption: 0.6875rem;                        /* 11px */

    /* Spacing */
    --max-width:   56rem;    /* ~900px */
    --gap:         1.5rem;
    --section-gap: 4rem;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-small);
    z-index: 100;
}
.skip-link:focus {
    top: 0;
}

/* --------------------------------------------------------------------------
   Header / Nav
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--fg-dim);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

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

.site-header nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.site-header nav a {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--fg-dim);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    letter-spacing: 0.01em;
    transition: color 150ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem var(--gap) 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Hero text */
.prompt-line {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--fg-dim);
    margin-bottom: 0.75rem;
    letter-spacing: 0.01em;
}

.prompt-symbol {
    color: var(--accent);
}

.prompt-cmd {
    color: var(--fg);
}

.hero-name {
    font-family: var(--font-mono);
    font-size: var(--text-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--fg);
    margin-bottom: 0.75rem;
}

.hero-role {
    font-size: var(--text-h3);
    color: var(--fg-dim);
    font-weight: 450;
    margin-bottom: 0.5rem;
    max-width: 65ch;
}

.hero-location {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--muted);
    letter-spacing: 0.01em;
}

/* Terminal window */
.hero-terminal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: var(--text-small);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}

.term-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
}
.term-dot--red   { background: #ff5f56; }
.term-dot--yellow { background: #ffbd2e; }
.term-dot--green  { background: #27c93f; }

.term-title {
    margin-left: 0.5rem;
    font-size: var(--text-caption);
    color: var(--muted);
    letter-spacing: 0.01em;
}

.terminal-body {
    padding: 0.75rem 1rem 1rem;
    line-height: 1.6;
    color: var(--fg-dim);
}

.term-prompt {
    color: var(--accent);
}

.term-output {
    color: var(--fg);
}

.term-cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--section-gap) var(--gap);
    border-top: 1px solid var(--border);
}

.section-heading {
    font-family: var(--font-mono);
    font-size: var(--text-h2);
    font-weight: 550;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--fg);
    margin-bottom: 2rem;
}

.heading-hash {
    color: var(--accent);
    font-weight: 400;
}

/* --------------------------------------------------------------------------
   Timeline (Experience)
   -------------------------------------------------------------------------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--accent);
    letter-spacing: 0.01em;
    padding-top: 0.2rem;
    text-align: right;
}

.timeline-content h3 {
    font-size: var(--text-body);
    font-weight: 550;
    color: var(--fg);
    margin-bottom: 0.15rem;
}

.timeline-company {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--fg-dim);
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
}

.timeline-details {
    list-style: none;
    padding: 0;
}

.timeline-details li {
    position: relative;
    padding-left: 1rem;
    font-size: var(--text-small);
    color: var(--fg-dim);
    line-height: 1.6;
}

.timeline-details li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--muted);
    font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Skills
   -------------------------------------------------------------------------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1.5rem;
}

.skill-category {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
}

.skill-label {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    font-weight: 550;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--fg);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    letter-spacing: 0.01em;
}

.tag small {
    font-size: 0.625rem;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.project-card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
}

.project-title {
    font-size: var(--text-body);
    font-weight: 550;
    color: var(--fg);
    margin-bottom: 0.35rem;
}

.project-stack {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.project-card p {
    font-size: var(--text-small);
    color: var(--fg-dim);
    line-height: 1.6;
    max-width: 65ch;
}

/* --------------------------------------------------------------------------
   Education
   -------------------------------------------------------------------------- */
.edu-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.edu-item {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
}

.edu-date {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--accent);
    letter-spacing: 0.01em;
    text-align: right;
}

.edu-content h3 {
    font-size: var(--text-body);
    font-weight: 550;
    color: var(--fg);
    margin-bottom: 0.15rem;
}

.edu-content p {
    font-size: var(--text-small);
    color: var(--fg-dim);
}

/* --------------------------------------------------------------------------
   Links & Demos
   -------------------------------------------------------------------------- */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1.5rem;
}

.link-group-title {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    font-weight: 550;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

.link-list a {
    font-size: var(--text-small);
    color: var(--fg-dim);
    text-decoration: none;
    display: inline-block;
    padding: 0.15rem 0;
    transition: color 150ms ease;
}

.link-list a:hover {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: var(--section-gap);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem var(--gap);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-label {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    font-weight: 550;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.cv-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cv-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-mono);
    font-size: var(--text-small);
    color: var(--fg);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 150ms ease, color 150ms ease;
    letter-spacing: 0.01em;
}

.cv-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cv-flag {
    font-weight: 550;
    color: var(--accent-dim);
    letter-spacing: 0.02em;
}

.footer-contact {
    text-align: right;
}

.footer-contact p {
    font-size: var(--text-small);
    color: var(--fg-dim);
    margin-bottom: 0.25rem;
}

.footer-contact a {
    color: var(--fg-dim);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: var(--text-small);
    transition: color 150ms ease;
}

.footer-contact a:hover {
    color: var(--accent);
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--muted);
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Global link style (non-nav, non-footer links demoted to fg underline
   when accent is already used on the same screen — per craft rules)
   -------------------------------------------------------------------------- */
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .term-cursor {
        animation: none;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .timeline-item,
    .edu-item {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .timeline-date,
    .edu-date {
        text-align: left;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-contact {
        text-align: left;
    }

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

@media (max-width: 480px) {
    .links-grid {
        grid-template-columns: 1fr;
    }

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