/* ==========================================================================
   Curtis Darst — personal site
   All theming lives in the :root block below.
   ========================================================================== */

:root {
  --bg: #fbf9f5;
  --bg-alt: #f2ede4;
  --ink: #1c2230;
  --ink-soft: #55606f;
  --accent: #0e7c72;
  --accent-soft: #dcf1ee;
  --coral: #f0603f;
  --coral-soft: #fde5df;
  --gold: #f2a33c;
  --violet: #6d5ae0;
  --violet-soft: #ece7fb;
  --grad: linear-gradient(120deg, #0e7c72 0%, #6d5ae0 55%, #f0603f 100%);
  --rule: #e2dacb;
  --card: #fff;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --maxw: 1060px;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 16.5px; line-height: 1.65; color: var(--ink); background: var(--bg); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.18; margin: 0 0 .55em; }
a { color: var(--accent); }
p { margin: 0 0 1em; }
img { max-width: 100%; }
section[id] { scroll-margin-top: calc(var(--header-height) + 1rem); }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; border-radius: 8px; background: var(--ink); color: #fff; text-decoration: none; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ----------------------------------------------------------------- nav -- */

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250,247,242,.94); backdrop-filter: blur(9px); border-bottom: 1px solid var(--rule); }
.nav { max-width: var(--maxw); min-height: var(--header-height); margin: 0 auto; padding: .75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-brand { font-family: var(--serif); font-weight: 700; font-size: 1.18rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 1.05rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; font-weight: 600; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.nav-cv { color: var(--accent); border: 1.5px solid var(--accent); border-radius: 7px; padding: .25rem .65rem; }
.nav-links a.nav-cv:hover { background: var(--accent); color: #fff; }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--rule); border-radius: 7px; font-size: 1.2rem; padding: .3rem .65rem; cursor: pointer; color: var(--ink); }

/* ---------------------------------------------------------------- hero -- */

.hero { padding: 6rem 1.25rem 5rem; position: relative; overflow: hidden; background: radial-gradient(900px 460px at 12% -5%, var(--coral-soft), transparent 60%), radial-gradient(1000px 520px at 88% 0%, var(--accent-soft), transparent 62%), radial-gradient(700px 420px at 60% 120%, var(--violet-soft), transparent 60%), var(--bg); }
.hero::before { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: var(--grad); }
.hero-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 3.5rem; }
.hero-text { flex: 1; }
.hero-photo { width: 280px; height: 280px; object-fit: cover; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 0 0 4px var(--coral), 0 18px 45px rgba(28,34,48,.22); flex-shrink: 0; }
.hero-kicker, .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--coral); }
.hero-kicker { display: inline-block; background: var(--coral-soft); padding: .35rem .85rem; border-radius: 99px; margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 680px; font-size: 1.14rem; color: var(--ink-soft); margin-top: 1rem; }
.hero-actions, .section-actions, .contact-links { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* --------------------------------------------------------------- buttons -- */

.btn { display: inline-block; padding: .68rem 1.25rem; border-radius: 8px; text-decoration: none; font-weight: 650; font-size: .94rem; transition: transform .15s, box-shadow .15s, background-position .4s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); background-size: 160% 160%; color: #fff; box-shadow: 0 6px 16px rgba(240,96,63,.25); }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 10px 25px rgba(109,90,224,.34); }
.btn-ghost { border: 1.5px solid var(--rule); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--coral); color: var(--coral); }

/* -------------------------------------------------------------- sections -- */

.section { padding: 4.5rem 1.25rem; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section h2 { font-size: clamp(1.75rem, 3.5vw, 2.35rem); margin-bottom: 1.45rem; }
.section-num { display: inline-block; font-family: var(--sans); font-size: .88rem; font-weight: 700; color: #fff; background: var(--accent); vertical-align: middle; margin-right: .7rem; width: 2.1rem; height: 2.1rem; line-height: 2.1rem; text-align: center; border-radius: 8px; box-shadow: 0 4px 10px rgba(14,124,114,.3); }
#experience .section-num, #contact .section-num { background: var(--coral); }
#projects .section-num { background: var(--gold); }
#education .section-num { background: var(--violet); }
#writing .section-num { background: var(--coral); }
.section-lede { color: var(--ink-soft); margin-top: -.75rem; margin-bottom: 2rem; max-width: 70ch; }
.text-link { font-weight: 650; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- about -- */

.about-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 3rem; align-items: start; }
.about-facts { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 1.5rem; display: grid; gap: 1.1rem; }
.fact { display: grid; gap: .12rem; font-size: .94rem; }
.fact-label { text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 700; color: var(--accent); }

/* ------------------------------------------------------------ experience -- */

.role-list { list-style: none; margin: 0; padding: 0; }
.role { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); align-items: start; }
.role:last-child { border-bottom: 0; }
.role-dates { font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: .25rem .7rem; text-align: center; justify-self: start; margin-top: .2rem; white-space: nowrap; }
.role-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; margin: 0 0 .1rem; }
.role-org { color: var(--ink-soft); font-weight: 600; font-size: .95rem; margin: 0 0 .6rem; }
.role-body { color: var(--ink-soft); font-size: .95rem; }
.role-body ul { margin: 0; padding-left: 1.1rem; }
.role-body li { margin-bottom: .3rem; }
.role-body li:last-child { margin-bottom: 0; }
.role-stack { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: .8rem 0 0; padding: 0; }
.role-stack li { margin: 0; padding: .2rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 650; background: var(--violet-soft); color: #4a3aa8; }

/* -------------------------------------------------------------- projects -- */

.repo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.repo-card, .feature-card { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 12px; padding: 1.5rem; color: var(--ink); }
.repo-card { text-decoration: none; display: flex; flex-direction: column; min-width: 0; height: 100%; transition: transform .15s, box-shadow .15s; }
.repo-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(31,35,40,.12); }
.repo-card:nth-child(2n) { border-top-color: var(--coral); }
.repo-card:nth-child(3n) { border-top-color: var(--violet); }
.repo-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.repo-icon { flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); background: var(--accent-soft); }
.repo-icon svg { width: 23px; height: 23px; }
.repo-name { font-family: var(--serif); font-weight: 700; font-size: 1.23rem; color: var(--accent); }
.repo-desc { color: var(--ink-soft); font-size: .94rem; flex: 1; }
.repo-meta { display: flex; gap: 1rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-top: .9rem; flex-wrap: wrap; }
.project-tag { align-self: flex-start; margin: .05rem 0 .8rem; padding: .25rem .65rem; border-radius: 999px; background: var(--coral-soft); color: #a33722; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* ------------------------------------------------------------- education -- */

.edu-hero { display: grid; grid-template-columns: 1fr; gap: 1.2rem; background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--violet); border-radius: 16px; padding: 2rem; margin-bottom: 1.5rem; box-shadow: 0 14px 34px rgba(28,34,48,.08); }
.edu-flag { display: inline-block; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; color: var(--violet); background: var(--violet-soft); padding: .3rem .8rem; border-radius: 99px; margin-bottom: .8rem; align-self: flex-start; }
.edu-hero h3 { font-size: 1.6rem; margin-bottom: .1rem; }
.edu-meta { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 1rem; }
.coursework { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.coursework li { margin: 0; padding: .3rem .75rem; border-radius: 8px; font-size: .84rem; background: var(--bg-alt); border: 1px solid var(--rule); color: var(--ink-soft); }
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.edu-card { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 12px; padding: 1.5rem; }
.edu-card:nth-child(2n) { border-top-color: var(--coral); }
.edu-card h3 { font-size: 1.2rem; margin-bottom: .15rem; }
.edu-card p { color: var(--ink-soft); font-size: .94rem; }
.edu-card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .94rem; }
.edu-card p:last-child, .edu-card ul:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- writing -- */

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li { display: flex; gap: 1.25rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.pub-year { font-weight: 700; color: var(--accent); min-width: 3.5rem; font-size: .8rem; text-align: center; background: var(--accent-soft); border-radius: 99px; padding: .2rem 0; align-self: flex-start; margin-top: .15rem; }
.pub-title { font-weight: 650; }
.pub-venue { color: var(--ink-soft); font-size: .92rem; }

/* -------------------------------------------------------------- features -- */

.feature-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.25rem; }
.feature-grid-three { grid-template-columns: repeat(3,1fr); }
.feature-card:nth-child(2) { border-top-color: var(--coral); }
.feature-card:nth-child(3) { border-top-color: var(--violet); }
.feature-card h3 { font-size: 1.3rem; }
.feature-card p { color: var(--ink-soft); font-size: .95rem; }
.feature-card p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- contact -- */

.section-contact { text-align: center; padding-bottom: 5.5rem; }
.contact-lede { color: var(--ink-soft); }
.contact-links { justify-content: center; }
.site-footer { border-top: 1px solid var(--rule); padding: 1.5rem 1.25rem; text-align: center; font-size: .83rem; color: var(--ink-soft); }
.site-footer p { margin: 0; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--rule); padding: .5rem 1.25rem 1rem; box-shadow: 0 14px 24px rgba(28,34,48,.08); }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .62rem 0; font-size: 1rem; }
  .nav-links a.nav-cv { border: 0; padding: .62rem 0; }
  .about-grid { grid-template-columns: 1fr; }
  .repo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid-three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 4rem 1.1rem 3.5rem; }
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 2rem; }
  .hero-photo { width: 165px; height: 165px; }
  .hero-sub { font-size: 1.04rem; }
  .section { padding: 3.6rem 1.1rem; }
  .about-grid, .repo-grid, .feature-grid, .feature-grid-three, .edu-grid { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: .5rem; }
  .role-dates { margin-top: 0; }
  .pub-list li { flex-direction: column; gap: .25rem; }
  .hero-actions .btn, .section-actions .btn { text-align: center; }
}

@media (max-width: 430px) {
  .hero-actions, .section-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn, .section-actions .btn { width: 100%; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .edu-hero { padding: 1.4rem; }
}

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

@media print {
  .site-header, .site-footer, .hero-actions, .section-actions, .contact-links { display: none; }
  body { background: #fff; font-size: 11pt; }
  .hero { padding: 1rem 0; background: none; }
  .section { padding: 1rem 0; break-inside: avoid; }
  .section-alt { background: none; }
}

/* Year chip inside certification lists. */
.cert-year { display: inline-block; margin-left: .35rem; font-size: .72rem; font-weight: 700; color: var(--ink-soft); background: var(--bg-alt); border: 1px solid var(--rule); border-radius: 99px; padding: .05rem .5rem; vertical-align: middle; }
.edu-card .eyebrow { color: var(--accent); }
.edu-card .edu-meta { margin-bottom: .7rem; }

/* Linked publication titles get a sliding underline. */
a.pub-title { color: var(--ink); text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .2s, color .2s; }
a.pub-title:hover, a.pub-title:focus-visible { color: var(--accent); background-size: 100% 1.5px; }

/* ------------------------------------------------- public repo listing -- */

.subhead { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin: 3rem 0 .35rem; padding-top: 2.4rem; border-top: 1px solid var(--rule); }
.repo-status { display: inline-flex; align-items: center; gap: .42rem; margin: 0 0 1.4rem; color: var(--ink-soft); font-size: .76rem; font-weight: 650; }
.repo-status::before { content: ""; width: .52rem; height: .52rem; flex: 0 0 auto; border-radius: 50%; background: #a7a198; }
.repo-status.is-live::before { background: #159a7d; box-shadow: 0 0 0 4px rgba(21,154,125,.12); }

.repo-list { list-style: none; margin: 0; padding: 0; }
.repo-list li { border-top: 1px solid var(--rule); padding: 1.15rem 0; margin: 0; }
.repo-list li:first-child { border-top: 0; padding-top: 0; }
.repo-row-head { display: flex; align-items: baseline; gap: .65rem; flex-wrap: wrap; margin-bottom: .3rem; }
.repo-link { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; color: var(--accent); text-decoration: none; }
.repo-link:hover { text-decoration: underline; }
.repo-lang { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); background: var(--bg-alt); border: 1px solid var(--rule); border-radius: 99px; padding: .14rem .6rem; }
.repo-stars { font-size: .78rem; font-weight: 650; color: var(--gold); }
.repo-updated { font-size: .75rem; color: #8b8478; margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.repo-list p { margin: 0; color: var(--ink-soft); font-size: .93rem; max-width: 80ch; }

@media (max-width: 720px) {
  .repo-updated { margin-left: 0; width: 100%; }
  .subhead { margin-top: 2.2rem; padding-top: 1.8rem; }
}
