/* Calm palette */
:root {
  --bg: #edf3f1;
  --ink: #153540;
  --ink-soft: #3f5d66;
  --tide: #c3dce0;
  --wave: #8fc3cc;
  --route: #e4a83b;
  --line: #bcd0cf;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.5px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--route);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  background: var(--ink); color: var(--bg);
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { left: 8px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 700px; }

/* Header */
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 12px;
}
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.2rem;
  letter-spacing: -0.01em; text-decoration: none;
}
.site-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--display); font-weight: 500; font-size: 1.02rem;
  color: var(--ink-soft); text-decoration: none; padding: 6px 0;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--route);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

/* Buttons */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 600; font-size: 1rem;
  padding: 12px 26px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none;
}
.btn:hover { background: var(--route); color: #153540; }
.tool {
  font-family: var(--display); font-weight: 500; font-size: 0.92rem;
  color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 16px; cursor: pointer;
}
.tool:hover { border-color: var(--ink); }
.tool.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tool.primary:hover { background: var(--route); border-color: var(--route); color: #153540; }

/* Home */
.hero { padding: 48px 0 36px; }
.hero h1 { font-size: clamp(2.9rem, 9vw, 5.8rem); font-weight: 700; letter-spacing: -0.035em; }
.hero .lead { font-size: 1.3rem; max-width: 36rem; margin-top: 20px; }
.hero .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-top: 28px; }
.hero .actions a:not(.btn) { font-family: var(--display); font-weight: 500; }

.route-panel { border: 1.5px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--bg); }
.route-panel canvas { display: block; cursor: cell; touch-action: pan-y; }
.route-bar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px 20px; padding: 16px 4px 0;
}
.route-status { font-family: var(--display); font-size: 0.98rem; color: var(--ink-soft); margin: 0; }
.route-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.route-note { font-size: 0.95rem; color: var(--ink-soft); max-width: 40rem; margin: 14px 4px 0; }
.home-end { height: 72px; }

/* Inner pages */
.page-head { padding: 48px 0 40px; }
.page-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 700; letter-spacing: -0.03em; }
.page-head p { color: var(--ink-soft); max-width: 34rem; margin-top: 14px; }
.block { padding-bottom: 64px; }
.block > h2 { font-size: 1.7rem; margin-bottom: 28px; }

/* About: the path through my last two years */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 44px 44px; }
.timeline li::before {
  content: ""; position: absolute; left: 7px; top: 14px; bottom: -14px;
  width: 3px; background: var(--tide);
}
.timeline li::after {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--ink);
}
.timeline li:last-child { padding-bottom: 56px; }
.timeline li:last-child::before {
  bottom: 0;
  background: repeating-linear-gradient(to bottom, var(--tide) 0 6px, transparent 6px 14px);
}
.timeline li.now::after { background: var(--route); }
.timeline .when { font-family: var(--display); font-weight: 500; font-size: 0.98rem; color: var(--ink-soft); margin: 0; }
.timeline h3 { font-size: 1.35rem; margin: 2px 0 6px; }
.timeline p:last-child { margin-bottom: 0; }

/* About: skills as short routes */
.leg { margin-bottom: 56px; }
.leg:last-child { margin-bottom: 0; }
.leg > h3 { font-size: 1.3rem; margin-bottom: 26px; }
.stops {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px;
}
.stops li { position: relative; padding-top: 40px; }
.stops li::before {
  content: ""; position: absolute; top: 11px; left: 0; right: -32px;
  height: 3px; background: var(--route);
}
.stops li:last-child::before { right: auto; width: 0; }
.stops li::after {
  content: ""; position: absolute; top: 3px; left: 0;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--ink);
}
.stops li:last-child::after {
  background: radial-gradient(circle, var(--route) 0 3px, var(--ink) 4px);
}
.stops h4 { font-size: 1.15rem; margin-bottom: 8px; }
.stops p { margin: 0; font-size: 1rem; line-height: 1.65; color: var(--ink-soft); }
.also { max-width: 36rem; }

/* Projects */
.project {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px 56px;
  padding: 44px 0; border-top: 1.5px solid var(--line);
}
.project h2 { font-size: 1.6rem; }
.project .hook {
  font-family: var(--display); font-weight: 600; font-size: 1.55rem;
  line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 16px;
}
.project p { margin-bottom: 0.9em; }
.project .more { margin: 10px 0 0; }
.more-link { padding: 36px 0 72px; border-top: 1.5px solid var(--line); margin: 0; }

/* Contact */
.email-link {
  display: inline-block; font-family: var(--display); font-weight: 700;
  font-size: clamp(1.5rem, 5.4vw, 2.7rem); letter-spacing: -0.02em; line-height: 1.2;
  overflow-wrap: anywhere;
}
.contact-line { margin-top: 36px; max-width: 34rem; }

/* Footer */
.site-footer .wrap { padding-top: 24px; padding-bottom: 32px; color: var(--ink-soft); font-size: 0.95rem; }

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .hero { padding-top: 32px; }
  .project { grid-template-columns: 1fr; padding: 32px 0; }
  .project .hook { font-size: 1.35rem; }
  .site-nav { gap: 18px; }

  .stops { grid-template-columns: 1fr; gap: 0; }
  .stops li { padding: 0 0 30px 44px; }
  .stops li::before { top: 16px; left: 8px; right: auto; width: 3px; height: 100%; }
  .stops li:last-child::before { width: 0; height: 0; }
  .stops li::after { top: 6px; }
  .stops li:last-child { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.route-stops { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.chip { font: inherit; font-family: var(--display); font-weight: 500; font-size: 0.95rem; color: var(--ink); background: transparent; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chip:hover { background: var(--tide); }
.chip[aria-pressed="true"] { background: var(--route); }
.chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.route-caption { margin: 16px 0 0; min-height: 3.2em; }
.route-caption a { font-weight: 600; }

#maze { touch-action: manipulation; }
#maze:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.chip.done { background: var(--tide); }
.chip.done[aria-pressed="true"] { background: var(--route); }
.maze-section { margin: 0 0 56px; }
.maze-card { margin-top: 20px; padding: 22px 26px; border: 2px solid var(--ink); border-radius: 20px; background: var(--bg); }
.maze-card[hidden] { display: none; }
.maze-card h3 { font-size: 1.5rem; margin: 0 0 8px; }
.maze-card p:last-child { margin-bottom: 0; }
.all-heading { font-size: 1.6rem; margin: 0 0 8px; }
.maze-section .route-panel { max-width: 700px; }

.how { margin: 26px 0 8px; }
.how h3 { font-size: 1.1rem; margin: 0 0 14px; }
.how-demo { margin: 0 0 22px; max-width: 640px; }
.how-demo canvas { display: block; border: 1px solid var(--line); border-radius: 16px; touch-action: pan-y; }
.how-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.how-steps li { position: relative; padding: 0 0 18px 46px; counter-increment: step; }
.how-steps li:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 28px; bottom: 2px; width: 3px; background: var(--tide); }
.how-steps li::after { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--ink); background: var(--bg); font: 700 0.78rem/20px var(--display); text-align: center; color: var(--ink); }
.how-steps li.active::after { background: var(--route); }
.how-steps h4 { margin: 0; font-size: 1.05rem; }
.how-steps p { margin: 4px 0 0; color: var(--ink-soft); }
.how-steps.js li:not(.active) p { display: none; }
.how-steps .step { font: inherit; font-family: var(--display); font-weight: 600; color: var(--ink); background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; }
.how-steps .step:hover { text-decoration: underline; text-decoration-color: var(--route); text-decoration-thickness: 3px; }
.how-steps .step:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.how-demo:empty { display: none; }
.contact-links { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }

.contact-links { gap: 14px; }
.contact-links .email-link { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }

/* Panels over the sky stay readable */
.route-panel { background: var(--bg); }
.maze-section .route-panel { background: rgba(255, 255, 255, 0.55); }


/* Optional photo background. Only used if sky-photo.jpg exists. */
html.has-photo { background: linear-gradient(rgba(237,243,241,0.6), rgba(237,243,241,0.6)), var(--photo) center / cover fixed; }
html.has-photo body { background: transparent; }

/* Testimonials */
.quote { position: relative; margin: 0 0 32px; padding: 6px 0 0 28px; border-left: 3px solid var(--tide); }
.quote::before { content: "\201C"; position: absolute; left: 22px; top: -22px; font: 700 4.5rem/1 var(--display); color: var(--route); }
.quote blockquote { margin: 0; padding-top: 26px; }
.quote blockquote p { font-size: 1.12rem; font-style: italic; margin: 0 0 14px; }
.quote figcaption { color: var(--ink-soft); font-size: 0.98rem; }
.quote figcaption strong { display: block; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
@media (max-width: 640px) { .quote { padding-left: 20px; } .quote::before { left: 14px; } }
.add-quote { margin: 8px 0 0; color: var(--ink-soft); max-width: 34rem; }

.quote-add { margin-top: 12px; padding: 22px 26px; border: 2px dashed var(--wave); border-radius: 20px; }
.quote-add h2 { font-size: 1.3rem; margin: 0 0 6px; }
.quote-add p { color: var(--ink-soft); margin: 0 0 12px; max-width: 34rem; }

/* Scroll reveal */
html.reveal-on .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; transition-delay: var(--d, 0s); }
html.reveal-on .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.reveal-on .reveal { opacity: 1; transform: none; transition: none; } }
