/* ============================================================
   INA — portfolio styles
   Look: engineering drawing sheet. Warm paper, dark ink,
   one safety-orange accent, mono "title block" labels.
   Change the colors in :root and the whole site follows.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    --paper: #f6f4ef;
    --paper-2: #edeae2;
    --ink: #1b1d21;
    --ink-2: #4a4e57;
    --ink-3: #868a93;
    --line: #d5d1c7;
    --accent: #e8590c;
    --accent-soft: #fbe3d4;
    --done: #2f7a4f;

    --sans: "Space Grotesk", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;

    --max: 1080px;
    --radius: 4px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background-color: var(--paper);
    /* faint drafting grid */
    background-image:
        linear-gradient(var(--paper-2) 1px, transparent 1px),
        linear-gradient(90deg, var(--paper-2) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
}

img { max-width: 100%; display: block; }

[hidden] { display: none !important; }

.case .lede { font-size: 1.15rem; color: var(--ink-2); }

a { color: inherit; }

main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3rem 1.25rem 5rem;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1rem; }

.label {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ---------- NAV (works with the existing <nav><a>…</a></nav> markup) ---------- */

nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.5rem;
    padding: 0.9rem max(1.25rem, calc((100% - var(--max)) / 2 + 1.25rem));
    background: rgba(246, 244, 239, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

nav a {
    text-decoration: none;
    color: var(--ink-2);
    padding: 0.2rem 0;
    border-bottom: 2px solid transparent;
}

nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

nav a:first-child {
    margin-right: auto;
    font-weight: 500;
    color: var(--ink);
}

nav a:first-child::before {
    content: "";
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    margin-right: 0.5rem;
    background: var(--accent);
    vertical-align: 0.05rem;
}

/* ---------- PAGE HEADER ---------- */

main > header { margin-bottom: 2.5rem; }
main > header p { color: var(--ink-2); max-width: 60ch; font-size: 1.1rem; }

/* ---------- HOME HERO ---------- */

.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2.5rem;
    align-items: center;
    padding: 2rem 0 3.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 3.5rem;
}

.hero h1 span { color: var(--accent); }

.hero .lede {
    font-size: 1.2rem;
    color: var(--ink-2);
    max-width: 52ch;
}

.hero-photo {
    width: 220px;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--ink);
    padding: 6px;
    background: #fff;
}

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.85rem;
    background: #fff;
    transition: background 0.15s, color 0.15s;
}

.button:hover { background: var(--ink); color: var(--paper); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- SECTIONS ---------- */

.section { margin-bottom: 4rem; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--ink);
}

.section-head h2 { margin: 0; }
.section-head a { font-family: var(--mono); font-size: 0.85rem; }

/* ---------- PROJECT CARDS ---------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
}

.project-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
}

.project-body { padding: 1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.project-body h3 { margin: 0; }
.project-body p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

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

.tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--ink-2);
}

.tag.status-done { color: var(--done); border-color: currentColor; }
.tag.status-wip { color: var(--accent); border-color: currentColor; }

/* filter buttons on the projects page (also used by the writing gallery) */

.filters, .gallery-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }

.filters button, .gallery-toggle {
    font-family: var(--mono);
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    cursor: pointer;
}

.filters button:hover, .gallery-toggle:hover { border-color: var(--ink); color: var(--ink); }
.filters button.active, .gallery-toggle.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* "other work" list */

.other-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.other-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

.other-list li span:first-child { font-weight: 500; }

/* ---------- SKILLS ---------- */

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.skills > div { background: #fff; padding: 1.1rem 1.2rem; }
.skills .label { display: block; margin-bottom: 0.4rem; color: var(--accent); }
.skills p { margin: 0; }

/* ---------- PROJECT (CASE STUDY) PAGE ---------- */

.case { max-width: 760px; }

.back { font-family: var(--mono); font-size: 0.85rem; text-decoration: none; color: var(--ink-2); }
.back:hover { color: var(--accent); }

.title-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    border: 1px solid var(--ink);
    margin: 1.25rem 0 2rem;
    background: #fff;
}

.title-block div { padding: 0.6rem 0.8rem; border-right: 1px solid var(--line); }
.title-block div:last-child { border-right: 0; }
.title-block .label { display: block; }
.title-block strong { font-weight: 500; font-size: 0.95rem; }

.case-hero {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border: 1px solid var(--line);
    margin-bottom: 2.5rem;
    background: #fff;
}

.case h2 {
    font-size: 0.8rem;
    font-family: var(--mono);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 2.25rem 0 0.6rem;
}

.case ul { padding-left: 1.2rem; }

.case figure { margin: 1.5rem 0; }
.case figure img { width: 100%; border: 1px solid var(--line); background: #fff; }
.case figure video { display: block; width: 100%; max-width: 360px; height: auto; border: 1px solid var(--line); background: #000; }
.case figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin-top: 0.4rem; }

.figure-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.figure-pair figure { margin: 0; }

.callout {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
}

.callout strong { font-size: 1.6rem; display: block; line-height: 1.2; }

.next-project {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ink);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.next-project a { text-decoration: none; }
.next-project a:hover { color: var(--accent); }

/* image placeholder (shown until the real photo is added to /images) */

.img-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background:
        repeating-linear-gradient(45deg, var(--paper-2) 0 10px, var(--paper) 10px 20px);
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 0.72rem;
    word-break: break-all;
    aspect-ratio: 4 / 3;
    width: 100%;
}

/* ---------- ABOUT ---------- */

.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: 3rem; align-items: start; }
.about-grid .hero-photo { width: 100%; }

.roles { list-style: none; padding: 0; margin: 1.5rem 0; }
.roles li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.roles .label { display: block; }

/* ---------- FOOTER ---------- */

footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-3);
}

footer a { color: var(--ink-2); }

/* ============================================================
   EXISTING: writing gallery cards (used by gallery.js)
   ============================================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.gallery-entry {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gallery-entry:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }

.entry-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 0;
    text-decoration: none;
    color: inherit;
}

.entry-thumbnail { width: 100%; flex: 1; object-fit: cover; }

.entry-title { padding: 0.75rem; font-weight: 600; text-align: center; }

.audio-player { padding: 0 0.75rem 0.75rem; display: flex; align-items: center; gap: 0.5rem; }

.play-button {
    font: inherit;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

/* poem pages */

.poem-entry { max-width: 640px; }
.date { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); }
.poem p { margin: 0 0 0.25rem; }

/* ============================================================
   EXISTING: inquiries form
   ============================================================ */

.hidden-field { position: absolute; left: -9999px; }

.inquiry-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 520px; margin-top: 1.5rem; }

.form-row { display: flex; flex-direction: column; gap: 0.4rem; }

.form-row label { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }

.form-row input,
.form-row textarea {
    font: inherit;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: #fff;
    color: inherit;
    resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.inquiry-form button {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 0.7rem 1.6rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background-color: var(--accent);
    color: #fff;
    cursor: pointer;
}

.inquiry-form button:hover { background-color: var(--ink); border-color: var(--ink); }

/* ---------- SMALL SCREENS ---------- */

@media (max-width: 720px) {
    body { font-size: 16px; }
    nav a:first-child { flex-basis: 100%; }
    .hero { grid-template-columns: 1fr; }
    .hero-photo { width: 160px; order: -1; }
    .about-grid { grid-template-columns: 1fr; }
    .about-grid .hero-photo { width: 200px; }
    .figure-pair { grid-template-columns: 1fr; }
}

/* ============================================================
   CAR.KIV — profile-style section for the project car
   ============================================================ */

.car-cover {
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--paper-2);
}

.img-ph.car-cover { aspect-ratio: 3 / 1; }

.car-head {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    margin: -3.25rem 0 2.5rem 1.25rem;
    position: relative;
}

.car-avatar {
    flex: none;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--paper);
    box-shadow: 0 0 0 1px var(--ink);
    background: #fff;
}

.img-ph.car-avatar { aspect-ratio: 1; padding: 0; border-radius: 50%; font-size: 0.55rem; overflow: hidden; }

.car-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.8rem); }
.car-head .lede { margin: 0.2rem 0 0; color: var(--ink-2); }

.car-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.car-intro {
    position: sticky;
    top: 4.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}

.car-intro h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.car-intro p { font-size: 0.95rem; color: var(--ink-2); }

.car-facts { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.car-facts li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.car-facts .label { display: block; }

.bundle { margin-bottom: 3rem; }

.bundle-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ink);
}

.bundle-head h2 { margin: 0; font-size: 1.3rem; }

.project-card.is-draft { border-style: dashed; background: transparent; cursor: default; }
.project-card.is-draft:hover { transform: none; box-shadow: none; border-color: var(--line); }

.table-wrap { overflow-x: auto; }

.spec-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--ink);
    font-size: 0.95rem;
    margin: 1rem 0;
}

.spec-table th,
.spec-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); }

.spec-table th {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 500;
}

@media (max-width: 720px) {
    .car-layout { grid-template-columns: 1fr; }
    .car-intro { position: static; }
    .car-head { margin-left: 0.5rem; }
    .car-avatar { width: 96px; height: 96px; }
}

.car-feed .project-grid { align-items: start; }

.car-cover { object-position: 50% 55%; }
.car-head.no-avatar { margin: 1.5rem 0 2.5rem; }
.car-intro .car-avatar { display: block; margin: 1rem 0; }
.case figure.tall img { max-width: 420px; }
.case figure.tall img { display: block; margin-left: auto; margin-right: auto; }
