/* ==========================================================================
   duganit.com site styles
   Palette is borrowed from fiber jackets: OM3/OM4 aqua for finished work,
   single-mode yellow for work in progress.
   ========================================================================== */

:root {
  --paper: #eef1f3;
  --surface: #ffffff;
  --ink: #17202b;
  --ink-soft: #4a5663;
  --rule: #c9d1d9;
  --fiber: #0f8484;      /* aqua: done / links */
  --fiber-text: #0a6868; /* aqua dark enough for body-size text */
  --smf: #d99e00;        /* yellow: in progress */
  --planned: #9aa5b1;    /* gray: not started */
  --code-bg: #e2e7eb;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --measure: 68ch;
  --page: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10161d;
    --surface: #17202a;
    --ink: #e6ebf0;
    --ink-soft: #9aa7b4;
    --rule: #2a3642;
    --fiber: #3fc1be;
    --fiber-text: #5fd0cd;
    --smf: #f2c230;
    --planned: #56636f;
    --code-bg: #1e2934;
  }
}
:root[data-theme="dark"] {
  --paper: #10161d;
  --surface: #17202a;
  --ink: #e6ebf0;
  --ink-soft: #9aa7b4;
  --rule: #2a3642;
  --fiber: #3fc1be;
  --fiber-text: #5fd0cd;
  --smf: #f2c230;
  --planned: #56636f;
  --code-bg: #1e2934;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
}

a { color: var(--fiber-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--fiber); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  line-height: 1.1;
  margin: 0;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; font-variation-settings: "wdth" 100; }

p { margin: 0 0 1em; max-width: var(--measure); }

code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
  max-width: 100%;
}
pre code { background: none; padding: 0; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ---------- Header ---------- */

.site-header { padding: 1.4rem 0; }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wordmark {
  font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none;
  font-variation-settings: "wdth" 120;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------- Hero ---------- */

.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero h1 {
  font-size: clamp(3rem, 11vw, 7.25rem);
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.03em;
  line-height: 0.92;
}
.hero .lede {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.45;
  color: var(--ink-soft);
  margin-top: 1.4rem;
  max-width: 44ch;
}

/* Cert path: the one bold element on the page.
   Each step is a node joined to the next by a "fiber run". */
.cert-path {
  list-style: none; margin: 3rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--steps, 6), 1fr);
}
.cert-path li { position: relative; padding-top: 2.1rem; padding-right: 0.75rem; }
.cert-path li::before { /* run to the next node */
  content: ""; position: absolute; top: 0.6rem; left: 0; right: 0;
  border-top: 4px solid var(--fiber);
}
.cert-path li:last-child::before { right: auto; width: 0; }
.cert-path li::after { /* node */
  content: ""; position: absolute; top: 0; left: 0;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--fiber); border: 4px solid var(--paper);
  box-shadow: 0 0 0 2px var(--fiber);
}
.cert-path .cert { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.cert-path .when { display: block; font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.2rem; }

.cert-path li[data-state="current"]::before { border-top: 4px dashed var(--planned); }
.cert-path li[data-state="current"]::after {
  background: var(--paper); box-shadow: 0 0 0 4px var(--smf);
}
.cert-path li[data-state="planned"]::before { border-top: 2px dashed var(--planned); top: 0.7rem; }
.cert-path li[data-state="planned"]::after {
  background: var(--paper); box-shadow: 0 0 0 2px var(--planned);
}
.cert-path li[data-state="planned"] .cert { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 720px) {
  .cert-path { grid-template-columns: 1fr; margin-top: 2.25rem; }
  .cert-path li { padding: 0 0 1.4rem 2.4rem; }
  .cert-path li::before { top: 0.6rem; bottom: -0.6rem; left: 0.6rem; right: auto; border-top: 0; border-left: 4px solid var(--fiber); }
  .cert-path li:last-child::before { display: none; }
  .cert-path li[data-state="current"]::before { border-top: 0; border-left: 4px dashed var(--planned); }
  .cert-path li[data-state="planned"]::before { border-top: 0; border-left: 2px dashed var(--planned); left: 0.66rem; top: 0.7rem; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(2.75rem, 7vw, 4.5rem) 0; border-top: 1px solid var(--rule); }
.section-grid { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem 3rem; }
.section-grid > h2 { position: sticky; top: 1.5rem; align-self: start; }
@media (max-width: 820px) {
  .section-grid { grid-template-columns: 1fr; }
  .section-grid > h2 { position: static; }
}

/* About */
.about-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: 2.5rem; }
.about-body p:first-child { font-size: 1.2rem; line-height: 1.5; }
.now { border-left: 4px solid var(--smf); padding-left: 1.1rem; align-self: start; }
.now h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.now ul { margin: 0; padding-left: 1.1rem; }
.now li { margin-bottom: 0.45rem; }
@media (max-width: 960px) { .about-body { grid-template-columns: 1fr; } }

/* Toolbox */
.toolbox { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.85rem 2rem; }
.toolbox dt { font-weight: 700; }
.toolbox dd { margin: 0; color: var(--ink-soft); max-width: var(--measure); }
@media (max-width: 600px) {
  .toolbox { grid-template-columns: 1fr; gap: 0.15rem; }
  .toolbox dd { margin-bottom: 1rem; }
}

/* Projects */
.projects { list-style: none; margin: 0; padding: 0; }
.project { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.project:first-child { padding-top: 0; }
.project-head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.project h3 { font-size: 1.35rem; }
.status { font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-soft); }
.status::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--fiber); }
.status[data-state="building"]::before { background: var(--smf); }
.status[data-state="planned"]::before { background: transparent; box-shadow: inset 0 0 0 2px var(--planned); }
.stack { font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 0.4rem; }
.stack strong { color: var(--ink); font-weight: 600; }

/* Study log: a real timeline, newest first */
.log { list-style: none; margin: 0; padding: 0 0 0 1.6rem; border-left: 2px solid var(--rule); }
.log li { position: relative; padding-bottom: 1.6rem; }
.log li:last-child { padding-bottom: 0; }
.log li::before {
  content: ""; position: absolute; left: calc(-1.6rem - 6px); top: 0.45rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--fiber);
}
.log time { display: block; font-size: 0.9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.log p { margin: 0.15rem 0 0; }

/* Contact */
.contact-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.contact-links a { font-size: 1.25rem; font-weight: 600; }

/* ---------- Note (article) pages ---------- */

.note { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.note header { margin-bottom: 2.5rem; }
.note h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; max-width: 24ch; }
.note .meta { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.9rem; }
.note article { max-width: var(--measure); }
.note article h2 { font-size: 1.5rem; margin: 2.4rem 0 0.8rem; }
.note article ul, .note article ol { padding-left: 1.3rem; max-width: var(--measure); }
.note article li { margin-bottom: 0.4rem; }
.callout { border-left: 4px solid var(--smf); padding: 0.2rem 0 0.2rem 1rem; margin: 1.5rem 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer p { margin: 0; }
