/* eyoung21.github.io — one page; the only script draws the small cube by the name. Light by default, dark follows the system setting. */

:root {
    --bg: #fbfaf7;
    --ink: #1c1d1b;
    --muted: #595c57;
    --rule: #e2dfd7;
    --accent: #0b6b3d;
    --accent-strong: #074d2b;
    --shade: rgba(28, 29, 27, 0.08);
    --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141614;
        --ink: #e6e4de;
        --muted: #a6a9a3;
        --rule: #2c2f2b;
        --accent: #72cf9a;
        --accent-strong: #a4e3bf;
        --shade: rgba(255, 255, 255, 0.08);
    }
}

*, *::before, *::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.1875rem;
    line-height: 1.6;
    font-optical-sizing: auto;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--bg); }

.page {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Top navigation */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    font-size: 1rem;
    margin-bottom: 3.5rem;
}
.top-nav a { color: var(--muted); text-decoration: none; }
.top-nav a:hover { color: var(--ink); text-decoration: underline; }

/* Intro */
.intro {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 2rem;
    align-items: start;
}
h1 {
    font-size: 2.75rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
}
.tesseract {
    width: 2.7rem;
    height: 2.7rem;
    margin-left: 0.6rem;
    vertical-align: -0.3rem;
    color: var(--accent);
    cursor: grab;
    touch-action: none;
}
.tesseract:active { cursor: grabbing; }
.lede {
    font-size: 1.45rem;
    line-height: 1.4;
    margin: 0 0 1.25rem;
}
.portrait {
    width: 8.5rem;
    height: 8.5rem;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--shade);
}
.intro-body { grid-column: 1 / -1; }
.contact-line {
    font-size: 1.05rem;
    color: var(--muted);
}

/* Sections */
section { margin-top: 3.75rem; }
h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}
h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.2rem;
}
h4 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin: 2rem 0 0.75rem;
}
p { margin: 0 0 1rem; }
cite { font-style: italic; }
.note { color: var(--muted); }
.small { font-size: 1.05rem; }

/* Publications */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { margin: 0 0 1.4rem; }
.pub-title { font-weight: 600; margin: 0; line-height: 1.35; }
.pub-meta { margin: 0.15rem 0 0; font-size: 1.05rem; line-height: 1.5; }
.pub-meta .venue { font-style: italic; }
.pub-links { font-size: 1rem; }
.pub-notice {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--muted);
    margin: 0.4rem 0 0;
}

/* Featured projects */
.project {
    display: grid;
    grid-template-columns: 15rem 1fr;
    gap: 1.5rem;
    align-items: start;
    margin: 0 0 2.25rem;
}
.project-shot { display: block; }
.project-shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 40 / 21;
    object-fit: cover;
    object-position: top left;
    border-radius: 6px;
    box-shadow: 0 0 0 1px var(--shade);
}
.project p { font-size: 1.05rem; margin-bottom: 0.6rem; }
.project .meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.15rem; }
.project .stack {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

/* Plain lists */
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin: 0 0 0.85rem; font-size: 1.05rem; }

/* Dated lists (experience, service) */
.dated { list-style: none; margin: 0; padding: 0; }
.dated li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
}
.when {
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 2.1;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    font-size: 0.95rem;
    color: var(--muted);
}
footer p { margin: 0 0 0.5rem; }

/* Small screens */
@media (max-width: 640px) {
    body { font-size: 1.125rem; }
    .page { padding: 1.75rem 1.25rem 3rem; }
    .top-nav { margin-bottom: 2.25rem; gap: 0.25rem 0.5rem; font-size: 0.84rem; }
    .intro { grid-template-columns: 1fr; }
    .portrait { width: 6rem; height: 6rem; margin-bottom: 1.25rem; grid-row: 1; }
    h1 { font-size: 2.25rem; }
    .lede { font-size: 1.3rem; }
    .project { grid-template-columns: 1fr; gap: 0.9rem; }
    .dated li { grid-template-columns: 1fr; gap: 0; }
    .when { line-height: 1.6; }
}

@media print {
    .top-nav, .portrait, .tesseract { display: none; }
    body { font-size: 11pt; background: #fff; color: #000; }
    a { color: inherit; text-decoration: none; }
    section { break-inside: avoid-page; }
}
