/* ==========================================================================
 *  custom.css
 *  1. Fonts
 *  2. Variables
 *  3. Base / theme overrides
 *  4. Utilities
 *  5. Site header (identity + links)
 *  6. Portfolio home (.pf)
 *  7. Projects (collapsible categories)
 *  8. Writeups
 *  9. CV
 *  10. Print
 *  ========================================================================== */


/* 1. FONTS (@import must be first or browsers ignore it)
 *  ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');


/* 2. VARIABLES
 *  ========================================================================== */
:root {
    /* CV */
    --cv-accent: #2b9fe0;   /* entry titles, skill highlights */
    --cv-gold:   #c9a84c;   /* CV section headings */
    --cv-text:   #8b92a3;
    --cv-muted:  #5b6478;   /* dates, keywords */
    --cv-serif:  'Crimson Pro', Georgia, serif;
    --cv-mono:   'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}


/* 3. BASE / THEME OVERRIDES
 *  ========================================================================== */
body {
    background: #080b14;
    font-size: 1.1rem;
    line-height: 1.75;
    text-align: left;
}

main { max-width: 78ch; }

.header { background: #0c1020; }
.menu__inner { font-family: monospace; background: none; }

p {
    font-family: var(--serif);
    font-size: 1rem;
}

p, li { text-align: left; }

h1, h2, h3, h4, h5, h6 {
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fa5185;
    margin-top: 2.5rem;
    text-align: left;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

hr {
    border: none;
    background-color: #fff;
    opacity: 1;
}


/* 4. UTILITIES
 *  ========================================================================== */
.no_caps { text-transform: none; }


/* 5. SITE HEADER (identity + links)
 *  ========================================================================== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 60rem;
    margin: 0 auto;
}

.id h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--name);
}

.id p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.links {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.6rem 2rem;
    justify-items: end;
    font-size: 0.85rem;
    color: #fa5185;                 /* fallback when --accent is undefined */
}

.links a {
    color: var(--accent);           /* overrides .links colour inside .pf */
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 600px) {
    .site-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .links { justify-items: start; }
}


/* 6. PORTFOLIO HOME (.pf)
 *  ========================================================================== */
.pf {
    --bg: #080b14;;
    --text: #8b93a7;
    --name: #d5d9e6;
    --accent: #d6336c;
    --link: #3b9ede;
    --tag: #c9a227;
    --line: #d9dbe3;
    --btn-bg: #141829;
    --btn-line: #3a3f55;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --serif: "Crimson Pro", "Libre Baskerville", Georgia, "Times New Roman", serif;

    background: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    max-width: none;
    margin: 0;
    padding: 1.5rem 0;
}
.pf a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Section heading */
.pf .section-block { margin-top: 2.5rem; }
.pf .section-block:first-child { margin-top: 0; }
.pf .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.9rem;
}
.pf .section-heading h2,
.pf .section-heading a {
    font-family: "JetBrains Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fa5185;
    text-align: left;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Work table */
.pf .work-list { border-top: 1px solid var(--line); }
.pf .work-row {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr) 12rem 1rem;
    column-gap: 1.25rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-align: left !important;
}
.pf .work-name {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--name);
    text-align: left !important;
}
.pf .work-description {
    font-size: 0.8rem;
    line-height: 1.45;
    text-align: left !important;
}
.pf .work-stack {
    font-family: var(--mono);
    font-size: 0.65rem;
    line-height: 1.5;
    color: var(--tag);
    text-align: right !important;
}
.pf .work-arrow {
    color: var(--link);
    font-size: 0.8rem;
    text-align: right !important;
}
.pf .work-row:hover .work-name { color: var(--link); }

/* Contact buttons */
.pf .hero-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.pf .hero-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: var(--btn-bg);
    border: 1px solid var(--btn-line);
    color: var(--name);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.pf .contact-row .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 18rem));
    justify-content: center;
    gap: 0.75rem;
}

.pf .hero-actions a:hover { border-color: var(--link); }
.pf .hero-actions svg { width: 0.9rem; height: 0.9rem; }

@media (max-width: 640px) {
    .pf .work-row { grid-template-columns: 1fr auto; row-gap: 0.3rem; }
    .pf .work-name,
    .pf .work-description,
    .pf .work-stack { grid-column: 1; text-align: left !important; }
    .pf .work-arrow { grid-column: 2; grid-row: 1; }
    .pf .hero-actions { grid-template-columns: 1fr; }
}


/* 7. PROJECTS (collapsible categories)
 *  ========================================================================== */
.project-cat {
    border: 1px solid var(--border, #8884);
    border-radius: 8px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.project-cat summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;                       /* remove default marker */
}
.project-cat summary::-webkit-details-marker { display: none; }
.project-cat summary::before {
    content: "▸";
    transition: transform 0.2s;
}
.project-cat[open] summary::before { transform: rotate(90deg); }

.cat-name { color: #fa5185; }
.cat-count {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.6;
}

.project-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 18rem;                      /* adjust to taste */
    overflow-y: auto;
    border-top: 1px solid var(--border, #8884);
}
.project-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #8882);
}
.project-list li:last-child { border-bottom: 0; }

.project-info p {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    opacity: 0.75;
}

.project-lang {
    flex-shrink: 0;                         /* stays right-aligned, never squashed */
    font-size: 0.75rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #8883;
    white-space: nowrap;
}


/* 8. WRITEUPS
 *  ========================================================================== */
.writeup-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* date column outside the card, card on the right */
.writeup {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.writeup-date {
    padding-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.6;
    white-space: nowrap;
}

.writeup-card {
    display: flex;
    gap: 1.25rem;
    padding: 1rem;
    border: 1px solid #8884;
    border-radius: 8px;
    min-width: 0;
}

.writeup-img {
    flex-shrink: 0;
    width: 11rem;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 6px;
    align-self: flex-start;
}

.writeup-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.writeup-title {
    margin: 0;
    overflow-wrap: anywhere;
}

.writeup-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.writeup-keywords li {
    font-size: 0.75rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #8883;
    white-space: nowrap;
}

.writeup-desc {
    margin: 0;
    opacity: 0.8;
    overflow-wrap: anywhere;
}

.writeup-read {
    margin-top: auto;                       /* pins the link to the bottom of the card */
    align-self: flex-start;
}

/* 8b. WRITEUP PAGE (single)
 *  ========================================================================== */
.writeup-page .wp-header { margin-bottom: 2rem; }

.writeup-page .wp-date {
    display: block;
    font-family: var(--cv-mono);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: #fa5185;
}

/* beats the global h1-h6 rule (small, uppercase, pink, mono) */
.writeup-page .wp-title {
    font-family: var(--cv-serif);
    font-size: 2.6rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: normal;
    text-transform: none;
    color: #fff;
    margin: 1rem 0;
}

.writeup-page .wp-subtitle {
    font-family: var(--cv-serif);
    font-size: 1.15rem;
    color: #6b7280;
    margin: 0 0 0.5rem;
}

.writeup-page .wp-author {
    font-family: var(--cv-mono);
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

.writeup-page .wp-content p,
.writeup-page .wp-content li {
    font-family: sans-serif);
    font-size: 1.22rem;
    line-height: 1.7;
    color: #c4c7cc;
}

/* section names: the global h1-h6 rule already makes these #fa5185,
 *  this just makes it explicit and tightens the spacing */
.writeup-page .wp-content h2,
.writeup-page .wp-content h3,
.writeup-page .wp-content h4 {
    color: #fff;;
    margin-top: 2.5rem;
}

.writeup-page .wp-content img,
.writeup-page .wp-content video {
    display: block;
    max-width: 100%;
    height: 20rem;
    margin: 1.5rem auto 1.5rem 0;  /* auto on the right = pinned left */
    border-radius: 6px;
}


/* mobile: date above the card, image above the text */
@media (max-width: 700px) {
    .writeup { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
    .writeup-date { padding-top: 0; }
    .writeup-card { flex-direction: column; }
    .writeup-img { width: 100%; }
}


/* 9. CV
 *  ========================================================================== */
.cv-section { margin-bottom: 2rem; }

/* Section headings: gold overrides the global pink h2 */
.cv-section h2 {
    font-family: var(--cv-mono);
    font-size: 1.05rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cv-gold);
    margin: 0 0 1rem;
}

/* Entry */
.cv-entry { margin-bottom: 1.1rem; break-inside: avoid; }

.cv-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

/* Title: blue overrides the global pink h3 */
.cv-entry-title {
    margin: 0;
    font-family: var(--cv-serif);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--cv-accent);
}
.cv-entry-title a { color: inherit; }
.cv-entry-title a:hover { text-decoration: underline; }

/* Right-aligned date or keywords */
.cv-entry-meta {
    font-family: var(--cv-mono);
    font-size: 0.78rem;
    color: var(--cv-muted);
    text-align: right;
    white-space: nowrap;
}
.cv-entry-meta.keywords {
    white-space: normal;
    max-width: 50%;
    font-style: normal;
}

/* Body text (subtitle, description, bullets, skills) */
.cv-entry-sub,
.cv-entry-desc,
.cv-entry-bullets,
.cv-skills p {
    font-family: var(--cv-serif);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--cv-text);
}

.cv-entry-sub { margin: 0.15rem 0 0; }

.cv-entry-desc { margin-top: 0.3rem; }
.cv-entry-desc p {                          /* beat the theme's global p rule */
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

.cv-entry-bullets { margin: 0.4rem 0 0 1.1rem; padding: 0; }
.cv-entry-bullets li { margin-bottom: 0.2rem; }
.cv-entry-bullets li::marker { color: var(--cv-muted); }

/* Technical skills (markdown block) */
.cv-skills p { margin: 0 0 0.45rem; }
.cv-skills strong {
    color: var(--cv-accent);
    font-weight: 600;
}

@media (max-width: 600px) {
    .cv-entry-head { flex-direction: column; gap: 0.1rem; }
    .cv-entry-meta,
    .cv-entry-meta.keywords { text-align: left; max-width: 100%; }
}


/* 10. PRINT / PDF
 *  ========================================================================== */
@media print {
    body { background: #fff; }

    .cv-section h2 { color: #7a6420; }
    .cv-entry-title,
    .cv-skills strong { color: #1a56db; }
    .cv-entry-sub,
    .cv-entry-desc,
    .cv-entry-bullets,
    .cv-skills p { color: #222; }
    .cv-entry-meta { color: #555; }
}

@media (max-width: 700px) {
    main,
    .site-header
     {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.menu__inner,
.menu__inner li, ul {
    background: #0c1020
}

li, ul {
    background: #080b14;
}
