/* system.css — portfolio design system (spec 2026-10-04).
   Loaded after styles.css, so equal-specificity rules here win. */

/* ---------- Tokens ---------- */
:root {
    --ink: #0b1526;
    --band: #0e1d34;
    --surface: #12213a;
    --line: #22365a;
    --text: #e9eef5;
    --muted: #93a6c1;
    --accent: #3cc6e8;
    --accent-ink: #06111f;
    --now: #f0b44c;

    --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;

    --fs-display: 48px;
    --fs-h2: 34px;
    --fs-h3: 22px;
    --fs-lead: 18px;
    --fs-body: 16px;
    --fs-small: 13px;

    --section-pad: 96px;
    --gutter: 32px;
    --radius: 12px;

    /* Re-point legacy tokens so old rules inherit the system palette */
    --dark-bg: var(--ink);
    --dark-card: var(--surface);
    --dark-card-hover: var(--surface);
    --bg-primary: var(--ink);
    --bg-secondary: var(--surface);
    --border-color: var(--line);
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --primary-color: var(--accent);
    --accent-color: var(--accent);
    --accent-gradient: var(--accent);
    --font-family: var(--font-body);
}

@media (max-width: 768px) {
    :root {
        --fs-display: 32px;
        --fs-h2: 26px;
        --fs-h3: 19px;
        --fs-lead: 16px;
        --fs-body: 15px;
        --section-pad: 64px;
        --gutter: 20px;
    }
}

/* ---------- Base ---------- */
body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.65;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

body > section[id]:not(#home) {
    padding: var(--section-pad) 0;
}

/* Alternating bands */
#about, #projects, #skills, #contact { background-color: var(--band); }
#results, #experience, #certifications { background-color: var(--ink); }

/* ---------- Section header ---------- */
.section-header {
    text-align: left;
    max-width: none;
    margin: 0 0 32px;
}

.section-title {
    font-family: var(--font-head);
    font-weight: 650;
    font-size: var(--fs-h2);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: currentColor;
    margin: 0 0 8px;
}

.section-subtitle {
    font-size: var(--fs-lead);
    line-height: 1.6;
    color: var(--muted);
    max-width: 65ch;
    margin: 0;
}

/* Card/slide/role titles share one h3 style */
.result-headline,
.project-title,
.exp-title,
.subsection-title {
    font-family: var(--font-head);
    font-weight: 650;
    font-size: var(--fs-h3);
    line-height: 1.3;
    letter-spacing: -0.005em;
}

/* ---------- Everything left-aligned ---------- */
.section-header, .result-card, .project-card, .experience-card, .skill-card, .cert-card,
.clients-section, .contact-content, .contact-info-card, .footer, .footer-content, .footer-bottom {
    text-align: left;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    box-shadow: none;
    transform: none;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn-primary:hover { background: #6fd6ef; border-color: #6fd6ef; color: var(--accent-ink); transform: none; box-shadow: none; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; transform: none; }

.text-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tags ---------- */
.tag, .exp-tag, .cert-tag, .skill-tag {
    font-size: var(--fs-small);
    font-weight: 500;
    line-height: 1.4;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Legend (hero strip, About panel, experience summary) ---------- */
.legend { margin: 0; }
.legend .legend-item { margin: 0; }
.legend dt { font-size: var(--fs-small); color: var(--muted); margin: 0 0 4px; }
.legend dd { margin: 0; color: var(--text); font-weight: 500; line-height: 1.5; }
.legend-rows .legend-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.legend-rows .legend-item:last-child { border-bottom: none; }
.legend-rows dt { margin: 0; font-size: 14px; }
.legend-sub { display: block; color: var(--muted); font-size: var(--fs-small); font-weight: 400; margin-top: 2px; }

.now-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--now);
    margin-right: 8px;
    vertical-align: 1px;
}

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Navigation ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 21, 38, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

.navbar.scrolled { box-shadow: none; }

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px var(--gutter);
}

.nav-brand {
    font-family: var(--font-head);
    font-weight: 650;
    font-size: 20px;
    color: var(--text);
}

.nav-brand i { color: var(--accent); font-size: 18px; }

.nav-menu { gap: 28px; }

.nav-link { font-size: 15px; font-weight: 500; color: var(--muted); }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link::after { background: var(--accent); height: 2px; }

@media (max-width: 768px) {
    .nav-menu.active {
        display: flex;
        flex-direction: column;
        gap: 12px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ink);
        border-bottom: 1px solid var(--line);
        text-align: left;
        align-items: flex-start;
        padding: 16px var(--gutter);
    }
}

/* ---------- Hero ---------- */
.hero {
    display: block;
    min-height: 0;
    padding: 72px 0 0;
    background: var(--ink);
    text-align: left;
    overflow-x: clip;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.hero-role {
    font-size: var(--fs-lead);
    color: var(--muted);
    margin: 0 0 12px;
}

.hero-title {
    font-family: var(--font-head);
    font-weight: 650;
    font-size: var(--fs-display);
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: currentColor;
    max-width: 20ch;
    margin: 0 0 16px;
}

.hero-lead {
    font-size: var(--fs-lead);
    line-height: 1.6;
    color: var(--muted);
    max-width: 52ch;
    margin: 0 0 28px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; }

.hero-figure {
    position: relative;
    margin: 0;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 220 / 250;
    justify-self: end;
}

.hero-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero-route .contours path { fill: none; stroke: var(--accent); stroke-opacity: 0.16; }
.hero-route .route-line { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 4 4; }
.hero-route .pin { fill: var(--accent); }
.hero-route .pin-now { fill: var(--now); }
.hero-route .pin-label { fill: var(--text); font: 500 8px var(--font-body); }
.hero-route .pin-label-now { fill: var(--now); font-weight: 600; }

.hero-route .route { animation: route-draw 1.6s ease-out 0.3s both; }

@keyframes route-draw {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-route .route { animation: none; }
}

.hero-portrait {
    position: absolute;
    left: 22%;
    top: 4%;
    width: 58%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.hero-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 56px 0 0;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    text-align: left;
}

@media (max-width: 768px) {
    .hero { padding-top: 40px; }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .hero-figure { justify-self: start; max-width: 340px; }
    .hero-legend { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 32px; }
}

/* ---------- About ---------- */
.about { overflow-x: clip; }

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.about-story { text-align: left; }

.about-story p {
    max-width: 65ch;
    margin: 0 0 16px;
    color: #c3cfdf;
    line-height: 1.7;
}

.about-story p:last-child { margin-bottom: 0; }

.about-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 24px 24px;
    text-align: left;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .about-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .about-panel { padding: 4px 20px 20px; }
    .legend-rows .legend-item { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ---------- How I optimise ---------- */
.carousel-track .result-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.carousel-track .result-card:hover { background: var(--surface); }
.carousel-track .metric-label { color: var(--accent); }
.carousel-track .result-step strong { font-family: var(--font-body); }
.carousel-track .result-description { border-left-color: var(--line); }
.carousel-track .result-step::before { background: var(--surface); border-color: var(--accent); }

.carousel-dot.active { border-color: var(--accent); background: rgba(60, 198, 232, 0.14); }

.clients-section {
    text-align: left;
    padding-top: 48px;
    margin-top: 48px;
    border-top: 1px solid var(--line);
}

.clients-label {
    text-align: left;
    font-size: var(--fs-small);
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 12px;
}

.clients-logos { justify-content: flex-start; gap: 8px 28px; }

.client-logo { background: none; border: none; padding: 0; border-radius: 0; }
.client-logo:hover { border: none; }
.client-logo span { color: var(--text); font-size: 15px; font-weight: 500; }

/* ---------- Projects ---------- */
.project-filters { justify-content: flex-start; margin: 0 0 24px; }

.filter-btn, .cert-filter-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    box-shadow: none;
}

.filter-btn:hover, .filter-btn.active, .cert-filter-btn:hover, .cert-filter-btn.active {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(60, 198, 232, 0.12);
}

.projects-grid { gap: 24px; }

.project-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    overflow: hidden;
}

.project-card:hover { border-color: var(--accent); box-shadow: none; }
/* Keyboard users reach the overlay's buttons, so show the overlay while one has focus */
.project-card:focus-within .project-overlay { opacity: 1; }
.project-overlay .btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.project-overlay .btn:hover { background: #63d4ef; border-color: #63d4ef; }

.project-image { height: 120px; background: var(--ink); border-bottom: 1px solid var(--line); }
.project-placeholder { font-size: 2.25rem; color: var(--accent); opacity: 0.85; }

.project-badge {
    background: var(--ink);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 4px 8px;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
}

.project-content { padding: 24px; }
.project-title { margin: 12px 0 8px; color: var(--text); }
.project-description { color: var(--muted); font-size: 15px; line-height: 1.6; }

.project-meta {
    font-size: var(--fs-small);
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 16px;
}

.projects-packages { margin-top: 64px; }
.subsection-lead { color: var(--muted); margin: 0 0 24px; }
.github-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
a.tech-item { border-color: var(--line); background: var(--surface); }

@media (max-width: 768px) {
    .project-image { height: 88px; }
    .project-content { padding: 20px; }
}

/* ---------- Experience ---------- */
.experience-timeline { gap: 16px; padding-left: 0; margin-bottom: 0; }

/* No connecting rail: in the gaps between cards it read as a stray line */
.experience-timeline::before { display: none; }

.experience-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 24px 24px 56px;
    box-shadow: none;
}

.experience-card:hover { border-color: var(--line); box-shadow: none; }
.experience-card:hover::before { transform: none; }

.experience-card::before,
.experience-card.highlight-card::before {
    left: 21px;
    top: 30px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    animation: none;
}

/* Moved down past the Current Role label so the dot lines up with the title */
.experience-card.is-current::before { background: var(--now); top: 69px; }

.experience-card.highlight-card {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: none;
}

.exp-title { color: var(--text); margin: 0 0 4px; }
.exp-company { color: var(--text); font-size: 15px; font-weight: 500; }
.exp-company i { color: var(--muted); }

.exp-period {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--fs-small);
    border-radius: 6px;
    padding: 4px 10px;
}

/* Full card width so its justified right edge matches the bullets below */
.exp-description { color: var(--muted); max-width: none; }
.exp-achievements li { font-size: 15px; color: var(--muted); }
.exp-achievements li strong { color: var(--text); }
.exp-achievements li > i { color: var(--accent); }

/* A small label above the role title */
.exp-badge {
    position: static;
    display: inline-block;
    margin: 0 0 10px;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: var(--fs-small);
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: none;
}

.experience-card.is-current .exp-badge { border-color: var(--now); color: var(--now); }

.timeline-group-title {
    padding-left: 0;
    margin: 24px 0 0;
    font-family: var(--font-body);
    font-size: 15px;
}

.experience-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    background: none;
    border: none;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 24px 0 0;
    margin-top: 48px;
}

.summary-stat { background: none; border: none; padding: 0; text-align: left; align-items: flex-start; }
.summary-icon { display: none; }

.summary-number {
    font-family: var(--font-head);
    font-size: var(--fs-h3);
    color: var(--text);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.summary-label { color: var(--muted); font-size: var(--fs-small); }

@media (max-width: 768px) {
    .experience-card { padding: 20px 20px 20px 48px; }
    /* Legacy phone rules hid the rail and dots; keep them so the current role stays marked */
    .experience-timeline::before { display: none; }
    .experience-card::before, .experience-card.highlight-card::before { display: block; left: 17px; }
    .experience-card.is-current::before { top: 81px; }
    .experience-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The legacy highlight rule painted the first bullet icon red; keep every bullet the same */
.experience-card.highlight-card .exp-achievements li:first-child i { color: var(--accent); }

/* ---------- Skills ---------- */
.skills .skills-grid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.skills .skill-card + .skill-card { border-top-color: var(--line); }
.skills .skill-title { font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--text); }
.skills .skill-icon { color: var(--accent); }
.skills .skill-tag { color: var(--text); background: transparent; border-color: var(--line); }

/* ---------- Certifications ---------- */
.cert-filters { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin: 0 0 24px; }
.cert-count { color: var(--muted); font-weight: 400; }

.certificates-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.cert-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: none;
}

.cert-card:hover { transform: none; border-color: var(--accent); box-shadow: none; }

/* Featured cards share the system card; their badge is a plain tag above the provider */
.cert-card.featured-cert { border: 1px solid var(--line); background: var(--surface); }
.cert-card.featured-cert:hover { border-color: var(--accent); }
.cert-badge {
    position: static;
    display: inline-block;
    margin: 0 0 10px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: var(--fs-small);
    font-weight: 500;
    box-shadow: none;
}
.cert-provider { color: var(--muted); font-size: var(--fs-small); }
.cert-provider i { color: var(--accent); }
.cert-title { font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text); }
.cert-link { color: var(--accent); font-size: var(--fs-small); }

.cert-actions { align-items: flex-start; padding-top: 24px; }
.cert-summary { background: none; border: none; padding: 0; color: var(--muted); }

/* Certificate links: quiet text links instead of filled buttons */
.cert-link,
.cert-link:hover {
    background: none;
    border: none;
    padding: 0;
    justify-content: flex-start;
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    box-shadow: none;
    transform: none;
}

.cert-link.placeholder-link {
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: none;
}

/* ---------- Contact ---------- */
.contact-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 48px;
    align-items: start;
}

.contact-info-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: none;
}

.availability-header h4, .contact-info-item h4 { font-family: var(--font-body); color: var(--text); }
.availability-text, .contact-info-item p { color: var(--muted); }

.contact-methods { justify-content: flex-start; gap: 12px; }

.contact-method {
    flex-direction: row;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
}

.contact-method:hover { border-color: var(--accent); color: var(--accent); transform: none; }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: none;
}

.form-group label { font-size: 14px; color: var(--text); text-align: left; }

.form-group input, .form-group select, .form-group textarea {
    background: var(--ink);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 8px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: none;
    outline: none;
}

/* ---------- Footer ---------- */
.footer { background: var(--ink); border-top: 1px solid var(--line); padding: 48px 0 24px; }
.footer-brand { font-family: var(--font-head); font-weight: 650; }
.footer-brand i { color: var(--accent); }
.footer-tagline, .footer-column a { color: var(--muted); }
.footer-column h4 { font-family: var(--font-body); color: var(--text); font-size: 14px; }
.footer-bottom { border-top: 1px solid var(--line); justify-content: space-between; text-align: left; }

@media (max-width: 768px) {
    .contact-content { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .footer-content, .footer-bottom { align-items: flex-start; text-align: left; }
}

/* ---------- Justified paragraphs ----------
   Card paragraphs get straight left and right edges; titles, tags and labels stay left-aligned.
   Hyphenation (needs lang="en" on <html>) keeps the word spacing even in narrow cards. */
.project-description,
.result-description,
.exp-description,
.exp-achievements li,
.availability-text {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}
