/* Tokyo Night: colours and fonts come from ../theme/tokens.css (theme/styles/tokens.css), shared with the homepage and the slide decks. */
@import url("../theme/tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400..700&display=swap");

* { box-sizing: border-box; }

html { color-scheme: dark; background: var(--tn-bg-dark); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(ellipse 60% 40% at 85% 40%, rgba(187, 154, 247, 0.05), transparent),
    radial-gradient(ellipse 50% 35% at 10% 75%, rgba(122, 162, 247, 0.05), transparent),
    linear-gradient(180deg, var(--tn-bg), var(--tn-bg-dark));
  color: var(--tn-fg);
  font-family: var(--tn-font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tn-cyan); text-decoration-color: rgba(125, 207, 255, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--tn-fg-bright); text-decoration-color: currentColor; }

/* Top bar, same as the homepage */
.top-bar {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  border-bottom: 1px solid rgba(122, 162, 247, 0.18);
  background: rgba(19, 20, 31, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Anchor targets (section headings) stay clear of the fixed top bar, kicker included */
[id] { scroll-margin-top: 104px; }

.page-menu {
  display: flex;
  width: min(100% - 48px, 1080px);
  height: 56px;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}

.crumbs {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 auto 0 0;
  font-family: var(--tn-font-mono);
  font-size: 0.95rem;
  white-space: nowrap;
}

.brand {
  color: var(--tn-fg-bright);
  font-weight: 600;
  text-decoration: underline 1px transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color 150ms ease;
}

.brand span { color: var(--tn-pink); }
.brand:hover,
.brand:focus-visible { color: var(--tn-fg-bright); text-decoration-color: var(--tn-pink); }
.crumb-sep { color: var(--tn-fg-dim); }
.crumb-here { color: var(--tn-fg-dim); }

.page-menu a:not(.brand) {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--tn-fg-dim);
  font-family: var(--tn-font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}

.page-menu a:not(.brand):hover,
.page-menu a:not(.brand):focus-visible {
  background: rgba(122, 162, 247, 0.1);
  color: var(--tn-fg-bright);
}

.page-menu a[aria-current="page"] {
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 -2px 0 var(--tn-orange);
  color: var(--tn-orange);
}

.shell {
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
  padding: 0;
}

/* Page header on the night street, like the decks' section slides */
.intro {
  margin-inline: calc(50% - 50vw);
  padding: 150px calc(50vw - 50%) 88px;
  border-bottom: 1px solid rgba(122, 162, 247, 0.18);
  background:
    linear-gradient(180deg, rgba(10, 12, 32, 0.4), rgba(10, 12, 32, 0.6) 70%, var(--tn-bg)),
    url("../street.webp") center 40% / cover no-repeat,
    var(--tn-bg);
}

.kicker {
  margin: 0 0 12px;
  color: var(--tn-orange);
  font-family: var(--tn-font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: var(--tn-fg-bright);
  font-size: clamp(2.5rem, 5.6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-shadow: 0 0 6px rgba(10, 12, 32, 0.9), 0 0 28px rgba(122, 162, 247, 0.6);
}

h1::after,
.section-header h2::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 4px;
  margin-top: 16px;
  border-radius: 2px;
  background: var(--tn-neon);
  box-shadow: 0 0 12px rgba(244, 166, 200, 0.45);
}

.intro-copy {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--tn-fg);
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 1px 8px rgba(10, 12, 32, 0.95);
}

.section-header {
  padding: 72px 0 34px;
  border-bottom: 1px solid var(--tn-border);
}

.section-header h2 {
  max-width: 720px;
  margin: 0;
  color: var(--tn-blue);
  font-size: clamp(1.9rem, 3.8vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.section-header h2::after { width: 3.5rem; margin-top: 12px; }

.section-intro {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--tn-fg-dim);
  font-size: 1.02rem;
  line-height: 1.75;
}

.guide + .guide { margin-top: 40px; }

ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: setup;
}

.guide > ol { position: relative; }

.guide > ol::before {
  content: "";
  position: absolute;
  top: 34px;
  bottom: 34px;
  left: 38px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(var(--tn-orange), var(--tn-pink) 50%, rgba(122, 162, 247, 0.15));
}

.guide > ol > li {
  position: relative;
  counter-increment: setup;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
}

.step-meta {
  position: relative;
  z-index: 1;
  padding: 34px 28px 34px 0;
  color: var(--tn-lamp);
  font-family: var(--tn-font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.step-meta::before {
  content: "0" counter(setup);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 216, 154, 0.4);
  border-radius: 8px;
  background: var(--tn-bg);
  box-shadow: inset 0 0 0 100px rgba(255, 216, 154, 0.08);
}

.tools-guide .step-meta::before { content: "0" counter(setup) " / 03"; }
.project-guide .step-meta::before { content: "0" counter(setup) " / 04"; }

.step-content {
  min-width: 0;
  padding: 32px 0 34px;
}

.step-content h3 {
  margin: 0 0 16px;
  color: var(--tn-magenta);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Terminal blocks */
.command {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--tn-border);
  border-radius: 10px;
  background: var(--tn-neon) top / 100% 2px no-repeat, var(--tn-bg-dark);
  box-shadow: 0 12px 30px rgba(4, 5, 16, 0.35);
}

.command + .command,
.command + .step-note,
.step-note + .command { margin-top: 12px; }

.prompt {
  flex: 0 0 auto;
  padding-left: 17px;
  color: var(--tn-green);
  font-family: var(--tn-font-mono);
  font-size: 0.88rem;
  user-select: none;
}

pre {
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 15px 18px 15px 9px;
  overflow-x: auto;
}

code,
.repo-link {
  font-family: var(--tn-font-mono);
  font-size: 0.86rem;
}

pre code { color: var(--tn-fg-bright); white-space: nowrap; }

.inline-code {
  padding: 1px 6px;
  border: 1px solid var(--tn-border);
  border-radius: 5px;
  background: var(--tn-surface);
  color: var(--tn-teal);
  font-family: var(--tn-font-mono);
  font-size: 0.86em;
}

.copy {
  flex: 0 0 auto;
  margin-right: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(125, 207, 255, 0.45);
  border-radius: 6px;
  background: rgba(125, 207, 255, 0.08);
  color: var(--tn-cyan);
  cursor: pointer;
  font-family: var(--tn-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.copy:hover,
.copy:focus-visible {
  border-color: var(--tn-cyan);
  background: var(--tn-cyan);
  color: var(--tn-bg-dark);
}

.repo-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--tn-border);
  border-radius: 10px;
  background: rgba(36, 40, 59, 0.55);
  color: var(--tn-fg);
  text-decoration: none;
  transition: border-color 150ms ease;
}

.repo-link span:first-child { min-width: 0; overflow-wrap: anywhere; }

.repo-link .arrow {
  flex: 0 0 auto;
  color: var(--tn-cyan);
  font-size: 1.15rem;
  transition: transform 150ms ease;
}

.repo-link:hover,
.repo-link:focus-visible { border-color: var(--tn-blue); color: var(--tn-fg-bright); }

.repo-link:hover .arrow { transform: translate(2px, -2px); }

.link-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.link-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid rgba(122, 162, 247, 0.6);
  border-radius: 10px;
  background: rgba(122, 162, 247, 0.08);
  color: var(--tn-blue);
  font-family: var(--tn-font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.link-option:hover,
.link-option:focus-visible {
  background: var(--tn-blue);
  box-shadow: 0 0 22px rgba(122, 162, 247, 0.35);
  color: var(--tn-bg-dark);
}

.intro .link-option,
.intro .callout {
  background-color: rgba(19, 20, 31, 0.86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.intro .link-option:hover,
.intro .link-option:focus-visible { background-color: var(--tn-blue); }

.step-note {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--tn-fg-dim);
  font-size: 0.95rem;
}

.step-note:last-child { margin-bottom: 0; }

/* Callout, like the decks' blockquotes */
.callout {
  max-width: 760px;
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid var(--tn-border);
  border-left: 4px solid var(--tn-magenta);
  border-radius: 8px;
  background: rgba(36, 40, 59, 0.6);
  color: var(--tn-fg);
  font-size: 0.95rem;
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--tn-magenta);
  font-family: var(--tn-font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.callout p { margin: 0; }

/* Footer on the skyline */
.site-footer {
  margin: 80px calc(50% - 50vw) 0;
  padding: 40px calc(50vw - 50%) 170px;
  background:
    linear-gradient(180deg, var(--tn-bg-dark) 10%, rgba(19, 20, 31, 0) 55%),
    url("../skyline.webp") center bottom / auto 280px repeat-x,
    var(--tn-bg-dark);
  font-family: var(--tn-font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.site-footer a {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--tn-border);
  border-radius: 10px;
  background: rgba(19, 20, 31, 0.75);
  color: var(--tn-fg);
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease;
}

.site-footer a + a { margin-left: 8px; }

.site-footer a:hover,
.site-footer a:focus-visible { border-color: var(--tn-blue); color: var(--tn-fg-bright); }

a:focus-visible,
button:focus-visible,
.hints summary:focus-visible {
  outline: 2px solid var(--tn-blue);
  outline-offset: 3px;
}

/* Assignments page */
.step-meta[data-label]::before { content: attr(data-label); }

.tasks {
  max-width: 760px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tasks li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 22px;
}

.tasks li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--tn-orange);
}

.tasks-label {
  margin: 18px 0 8px;
  color: var(--tn-teal);
  font-family: var(--tn-font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tasks .bonus { color: var(--tn-muted); }
.tasks .bonus::before { background: var(--tn-border); }

.code-block { max-width: 760px; }
.code-block pre { padding-left: 18px; }
.code-block pre code { white-space: pre; }

.hints {
  max-width: 760px;
  margin-top: 16px;
  border: 1px solid var(--tn-border);
  border-radius: 8px;
  background: rgba(36, 40, 59, 0.45);
  color: var(--tn-fg-dim);
  font-size: 0.95rem;
}

.hints summary {
  padding: 11px 16px;
  color: var(--tn-cyan);
  cursor: pointer;
  font-family: var(--tn-font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hints[open] summary { border-bottom: 1px solid var(--tn-border); }

.hints ul {
  margin: 0;
  padding: 14px 18px 14px 36px;
}

.hints li::marker { color: var(--tn-orange); }
.hints li + li { margin-top: 6px; }

@media (max-width: 720px) {
  .shell, .page-menu { width: min(100% - 30px, 1080px); }
  .page-menu { height: auto; flex-wrap: wrap; justify-content: space-between; padding: 10px 0 6px; row-gap: 6px; }
  .crumbs { flex-basis: 100%; font-size: 0.88rem; }
  .intro { padding-top: 140px; padding-bottom: 56px; }
  .guide > ol::before { display: none; }
  .guide > ol > li { grid-template-columns: minmax(0, 1fr); padding: 26px 0 28px; }
  .step-meta { padding: 0 0 10px; }
  .step-content { width: 100%; padding: 0; }
  .section-header { padding-top: 56px; }
  .site-footer { padding-bottom: 140px; background-size: auto, auto 200px, auto; }
  [id] { scroll-margin-top: 136px; }
}

@media (max-width: 460px) {
  .shell, .page-menu { width: min(100% - 24px, 1080px); }
  h1 { font-size: 2.4rem; }
  .copy { display: none; }
  .command pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .link-option { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
