/* ---------------------------------------------------------------------------
   Kristhian Vy Cadiz — resume
   Self-contained: no external fonts, scripts or stylesheets, so it opens from
   a USB stick on a locked-down machine and looks identical offline.
   --------------------------------------------------------------------------- */

:root {
    --ink:        #16181d;
    --ink-soft:   #3f434d;
    --paper:      #faf8f5;
    --paper-2:    #f2eee8;
    --line:       #e2ddd4;
    --accent:     #c2410c;
    --accent-2:   #9a3412;
    --accent-soft:#fdebd8;

    --display: "Segoe UI Semibold", "Helvetica Neue", Arial, system-ui, sans-serif;
    --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }

/* --- Hero ---------------------------------------------------------------- */
.hero {
    background: var(--ink);
    color: var(--paper);
    padding: 4.5rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}
/* Faint grid, like a terminal behind glass. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}
.hero .wrap { position: relative; }

.kicker {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 1rem;
}

.hero h1 {
    font-family: var(--display);
    font-size: clamp(2.3rem, 6.5vw, 3.9rem);
    line-height: 1.02;
    letter-spacing: -.025em;
    margin: 0 0 1.1rem;
    font-weight: 700;
}

.typed-line {
    font-family: var(--mono);
    font-size: clamp(.95rem, 2.6vw, 1.28rem);
    color: rgba(250, 248, 245, .58);
    min-height: 2em;
    margin: 0 0 2rem;
}
.typed-line .prompt { color: var(--accent); margin-right: .55rem; }
.typed-text { color: var(--paper); }
.caret {
    display: inline-block;
    width: .58ch;
    background: var(--accent);
    margin-left: 2px;
    animation: blink 1.05s steps(1) infinite;
    /* Sit on the text baseline rather than jumping the line height. */
    transform: translateY(.14em);
}
.caret::before { content: "\00a0"; }
@keyframes blink { 0%, 45% { opacity: 1 } 50%, 100% { opacity: 0 } }

.contact { display: flex; flex-wrap: wrap; gap: .55rem; }
.contact a, .contact span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .87rem;
    color: var(--paper);
    text-decoration: none;
    border: 1px solid rgba(250, 248, 245, .2);
    border-radius: 999px;
    padding: .38rem .85rem;
    transition: border-color .15s, background .15s;
}
.contact a:hover { border-color: var(--accent); background: rgba(194, 65, 12, .14); }
.contact .ico { color: var(--accent); font-size: .95em; }

/* --- Sections ------------------------------------------------------------ */
section { padding: 3rem 0 0; }
section:last-of-type { padding-bottom: 3.5rem; }

h2 {
    font-family: var(--mono);
    font-size: .74rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 1.4rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: baseline;
    gap: .6rem;
}
h2::before { content: "//"; opacity: .45; }

.summary p { font-size: 1.03rem; color: var(--ink-soft); margin: 0 0 1rem; max-width: 68ch; }
.summary p:first-child { color: var(--ink); font-size: 1.1rem; }

/* --- Skills -------------------------------------------------------------- */
/* min() so a narrow window shrinks the column instead of overflowing the page. */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(255px, 100%), 1fr)); gap: 1.1rem; }
.skill-card {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.1rem 1.15rem;
}
.skill-card h3 {
    font-family: var(--display);
    font-size: .95rem;
    margin: 0 0 .7rem;
    letter-spacing: -.01em;
}
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
    font-family: var(--mono);
    font-size: .74rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: .2rem .5rem;
    color: var(--ink-soft);
}
.tag.key { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }

/* --- Timeline ------------------------------------------------------------ */
.role { position: relative; padding: 0 0 1.9rem 1.65rem; border-left: 2px solid var(--line); }
.role:last-child { padding-bottom: .4rem; border-left-color: transparent; }
.role::before {
    content: "";
    position: absolute;
    left: -6px; top: .45rem;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--accent);
}
.role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.role h3 { font-family: var(--display); font-size: 1.08rem; margin: 0; letter-spacing: -.01em; }
.role .org { color: var(--accent-2); font-weight: 600; font-size: .93rem; }
.role .when {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--ink-soft);
    white-space: nowrap;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: .12rem .5rem;
}
.role ul { margin: .6rem 0 0; padding-left: 1.05rem; }
.role li { margin: .3rem 0; color: var(--ink-soft); }
.role li::marker { color: var(--accent); }

/* --- Lab / projects ------------------------------------------------------ */
.labs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.1rem; }
.lab {
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: 1.1rem 1.2rem;
    background: var(--paper-2);
}
.lab h3 { font-family: var(--display); font-size: 1rem; margin: 0 0 .6rem; }
.lab ul { margin: 0; padding-left: 1.05rem; }
.lab li { margin: .28rem 0; color: var(--ink-soft); font-size: .92rem; }
.lab li::marker { color: var(--accent); }

/* --- Education / closing ------------------------------------------------- */
.edu {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
}
.edu h3 { font-family: var(--display); font-size: 1.05rem; margin: 0 0 .15rem; }
.edu .school { color: var(--ink-soft); font-size: .93rem; }

.closing { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.closing li { padding-left: 1.4rem; position: relative; color: var(--ink-soft); }
.closing li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
}

footer {
    border-top: 1px solid var(--line);
    padding: 1.6rem 0 2.5rem;
    font-family: var(--mono);
    font-size: .76rem;
    color: var(--ink-soft);
    text-align: center;
}

/* Sections settle in as you scroll. Content is visible by default and only
   hidden once the script has confirmed it can reveal it again — a resume must
   never be blank because an observer did not fire. */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.js-reveal .reveal.seen { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .caret { animation: none; opacity: 1; }
    .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 560px) {
    .hero { padding: 3rem 0 2.5rem; }
    .role-head { flex-direction: column; gap: .2rem; }
}

/* --- Print: a clean one-piece resume, no theatrics ----------------------- */
@media print {
    @page { margin: 14mm; }
    body { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.42; }
    .wrap { max-width: none; padding: 0; }
    .hero { background: #fff; color: #000; padding: 0 0 .6rem; border-bottom: 2px solid #000; }
    .hero::before { display: none; }
    .hero h1 { font-size: 21pt; margin-bottom: .3rem; }
    .kicker { color: #000; margin-bottom: .35rem; }
    .typed-line { color: #000; min-height: 0; margin-bottom: .55rem; font-size: 10.5pt; }
    .typed-line .prompt, .caret { display: none; }
    .contact a, .contact span { border: 0; padding: 0 .8rem 0 0; color: #000; }
    .contact .ico { color: #000; }
    section { padding: .85rem 0 0; break-inside: avoid; }
    h2 { color: #000; border-bottom: 1px solid #000; margin-bottom: .55rem; font-size: 9pt; }
    h2::before { content: ""; }
    .skill-card, .lab, .edu, .tag { background: #fff; border-color: #999; }
    .lab { border-left: 2px solid #000; }
    .role { border-left: 1px solid #999; page-break-inside: avoid; }
    .role::before { background: #000; border-color: #000; }
    .role .when { background: #fff; border: 0; padding: 0; }
    .tag.key { background: #fff; color: #000; border-color: #000; }
    .reveal { opacity: 1; transform: none; }
    footer { display: none; }
    a { text-decoration: none; color: #000; }
}
