/* notes.ravindran.in - site styles
   To change the look, edit the colors in :root below (and the dark-mode block after it).
   Palette: slate ink on a cool paper, teal for links and actions,
   and the classic PowerShell console blue for every code block. */

:root {
  --paper: #f5f7f8;
  --surface: #ffffff;
  --ink: #17232d;
  --muted: #566877;
  --line: #d8e0e5;
  --teal: #03787c;
  --teal-strong: #025b5e;
  --teal-tint: #e3f1f1;
  --console: #012456;
  --console-bar: #0b3570;
  --console-text: #eef3fa;
  --radius: 8px;
  --wrap: 1120px;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Cascadia Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f171d;
    --surface: #16212a;
    --ink: #e3ebf0;
    --muted: #9aabb8;
    --line: #273641;
    --teal: #45c2c6;
    --teal-strong: #7ad8db;
    --teal-tint: #133238;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "tnum" 0;
}

img, svg { max-width: 100%; }

/* Keep the footer at the bottom on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--teal-strong); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 3px; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--teal-tint);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin: 0 0 1rem; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 60ch; margin: 0 0 1.75rem; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.2; }
.brand:hover { color: var(--ink); }
.brand-name { font-weight: 600; font-size: 1.05rem; }
.brand-sub { font-size: 0.82rem; color: var(--muted); }

.site-nav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.45rem 0.8rem; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.site-nav a:hover { background: var(--teal-tint); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--teal); background: var(--teal-tint); }
.site-nav .nav-ext a { color: var(--muted); }
.site-nav .nav-ext { margin-left: 0.5rem; padding-left: 0.75rem; border-left: 1px solid var(--line); }

.menu-toggle {
  display: none; font: inherit; font-size: 0.95rem; font-weight: 500;
  background: none; border: 1px solid var(--line); color: var(--ink);
  padding: 0.4rem 0.9rem; border-radius: 6px; cursor: pointer;
}

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.5rem 1rem 1rem; }
  .site-nav .nav-ext { margin: 0.5rem 0 0; padding: 0.5rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0 0 1.5rem; }
.btn {
  display: inline-block; padding: 0.7rem 1.15rem; border-radius: 6px;
  font-weight: 500; font-size: 0.98rem; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #06262a; } }
.btn-quiet { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-quiet:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.location { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }
.hero h1 { max-width: 12ch; }

.console { margin: 0; }
.console-bar {
  background: var(--console-bar); color: #b9c9e0; font-size: 0.8rem;
  padding: 0.45rem 0.9rem; border-radius: var(--radius) var(--radius) 0 0;
}
.console-body {
  margin: 0; background: var(--console); color: var(--console-text);
  font: 400 0.84rem/1.6 var(--mono); padding: 1.1rem 1.1rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius); overflow-x: auto;
  box-shadow: 0 18px 40px -24px rgba(1, 36, 86, 0.65);
}
.console-body code { background: none; padding: 0; font-size: inherit; color: inherit; overflow-wrap: normal; }
.console figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- release span ---------- */
.span { padding: clamp(2.5rem, 5vw, 3.5rem) 0; border-bottom: 1px solid var(--line); }
.span-intro { max-width: 60ch; margin: 0 0 2rem; }
.releases {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(8, minmax(7.5rem, 1fr));
  overflow-x: auto; scrollbar-width: thin;
}
.releases li { position: relative; padding: 1.4rem 1rem 0.25rem 0; }
.releases li::before {
  content: ""; position: absolute; top: 0.35rem; left: 0; right: 0; height: 2px; background: var(--line);
}
.releases li::after {
  content: ""; position: absolute; top: 0; left: 0; width: 0.8rem; height: 0.8rem;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--teal);
}
.releases li:last-child::after { background: var(--teal); }
.releases .year { display: block; font-weight: 600; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.releases .rel { display: block; color: var(--muted); font-size: 0.88rem; line-height: 1.35; }

/* ---------- content blocks ---------- */
.block { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.block-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: clamp(1.5rem, 5vw, 4rem); }
.col-head p { margin-top: 0; }
.col-head.wide { max-width: 62ch; margin-bottom: 2rem; }
@media (max-width: 820px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* guides list: a numbered sequence, so numbers are meaningful */
.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list a {
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; align-items: baseline;
  padding: 1.15rem 0.25rem; text-decoration: none; color: var(--ink);
}
.guide-list .num { font-weight: 600; font-size: 1.35rem; color: var(--teal); font-variant-numeric: tabular-nums; }
.guide-list .gtitle { display: block; font-weight: 600; font-size: 1.12rem; }
.guide-list .gsum { display: block; color: var(--muted); margin-top: 0.15rem; }
.guide-list a:hover .gtitle { color: var(--teal); text-decoration: underline; text-underline-offset: 0.18em; }
.guide-list.full { max-width: 820px; margin-bottom: 4rem; }

/* scripts */
.script-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
@media (max-width: 900px) { .script-columns { grid-template-columns: 1fr; } }
.script-group h2, .script-group h3 { margin-bottom: 0.25rem; }
.script-group > p { margin: 0 0 1rem; font-size: 0.95rem; }
.script-list { list-style: none; margin: 0; padding: 0; }
.script-list li { padding: 0.8rem 0; border-top: 1px solid var(--line); }
.script-list p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.script-link { font-family: var(--mono); font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }

.page-head { padding: clamp(2.5rem, 6vw, 4rem) 1.5rem 2rem; }
.page-head .lead { margin-bottom: 0; }

/* env table */
.env { width: 100%; border-collapse: collapse; }
.env th, .env td { text-align: left; padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.env tr:first-child th, .env tr:first-child td { border-top: 1px solid var(--line); }
.env th { font-weight: 500; width: 45%; }
.env code { white-space: nowrap; overflow-wrap: normal; }

/* ---------- documents (guides, script pages) ---------- */
.doc-wrap { padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: 4rem; }
.with-toc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.toc { position: sticky; top: 5.5rem; font-size: 0.9rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
.toc-title { font-weight: 600; margin: 0 0 0.5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--teal); border-left-color: var(--teal); }
@media (max-width: 980px) { .with-toc { grid-template-columns: 1fr; } .toc { display: none; } }

.doc { max-width: 76ch; min-width: 0; }
.doc h2 { margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.doc h3 { margin-top: 1.75rem; }
.doc p, .doc ul, .doc ol { margin: 0 0 1.1rem; }
.doc li { margin-bottom: 0.35rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.75rem; }
.script-title { font-family: var(--mono); font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.4rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }

.facts { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 0 0 1.5rem; }
.facts div { min-width: 0; }
.facts dt { font-size: 0.85rem; color: var(--muted); }
.facts dd { margin: 0.1rem 0 0; font-weight: 500; }
.flag { display: inline-block; font-size: 0.9rem; padding: 0.15rem 0.6rem; border-radius: 999px; }
.flag-read { background: var(--teal-tint); color: var(--teal-strong); }
.flag-change { background: #fdecd3; color: #7a4205; }
@media (prefers-color-scheme: dark) { .flag-change { background: #3d2a10; color: #f6c983; } }

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc thead th { border-bottom: 2px solid var(--ink); font-weight: 600; }
.params th { width: 34%; font-weight: 400; }
.params th code { font-weight: 500; }
.ptype { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.req { display: inline-block; font-size: 0.75rem; font-weight: 500; color: var(--teal-strong); margin-top: 0.25rem; }
.pdefault { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 0.3rem; }

/* ---------- code blocks: PowerShell console blue ---------- */
.doc pre {
  position: relative; margin: 0 0 1.5rem; background: var(--console); color: var(--console-text);
  font: 400 0.86rem/1.6 var(--mono); padding: 1rem 1.1rem; border-radius: var(--radius);
  overflow-x: auto; tab-size: 4;
}
.doc pre code { background: none; padding: 0; font-size: inherit; color: inherit; overflow-wrap: normal; }
.code-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1;
  font: 500 0.78rem var(--sans); padding: 0.3rem 0.65rem; border-radius: 5px;
  background: var(--console-bar); color: #d7e3f4; border: 1px solid #2a4f86; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.code-wrap:hover .copy-btn, .copy-btn:focus-visible, .copy-btn.done { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }

/* Syntax colors (Prism tokens), tuned for the console background */
.token.comment { color: #86a8cf; font-style: italic; }
.token.keyword, .token.boolean { color: #d3c2ff; }
.token.function { color: #f9e07f; }
.token.variable { color: #9ee39a; }
.token.string { color: #86e0df; }
.token.number { color: #f8b48c; }
.token.operator, .token.punctuation { color: #c9d6e8; }
.token.namespace { color: #b7c7dc; }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.pager a span { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.pager .next { text-align: right; }

/* ---------- home: topic status card and topic list ---------- */
.status-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.4rem 1.5rem 0.6rem; box-shadow: 0 18px 40px -28px rgba(1, 36, 86, 0.45);
}
.status-title { margin: 0 0 0.5rem; font-weight: 600; }
.status-card ul { list-style: none; margin: 0; padding: 0; }
.status-card li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.85rem 0; border-top: 1px solid var(--line); font-size: 1.1rem; font-weight: 500;
}
.st { font-size: 0.85rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.st-live { color: var(--teal-strong); }
.st-live::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--teal); margin-right: 0.45rem; vertical-align: 0.08em; }

.topic-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.topic-list li { border-bottom: 1px solid var(--line); }
.topic-row {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr) auto; gap: 1rem; align-items: baseline;
  padding: 1.15rem 0.25rem; color: var(--ink); text-decoration: none;
}
a.topic-row:hover .tname { color: var(--teal); text-decoration: underline; text-underline-offset: 0.18em; }
.tname { font-weight: 600; font-size: 1.15rem; }
.tdesc { color: var(--muted); }
div.topic-row .tname { color: var(--muted); }
@media (max-width: 620px) {
  .topic-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tdesc { grid-column: 1 / -1; grid-row: 2; }
}

.how p { margin: 0 0 1.1rem; max-width: 62ch; }
.how strong { font-weight: 600; }

.topic-head { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.topic-head .lead { margin-bottom: 0; }
.plan-list { margin: 0; padding-left: 1.2rem; }
.plan-list li { margin-bottom: 0.6rem; }

.all-scripts { padding-bottom: 4rem; }
.topic-scripts h2 { margin-bottom: 1.5rem; }
.topic-scripts h2 a { color: var(--ink); text-decoration: none; }
.topic-scripts h2 a:hover { color: var(--teal); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 0.9rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.footer-row p { margin: 0; }
.footer-links { display: flex; gap: 1.25rem; }

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

@media (max-width: 760px) {
  .releases { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1.25rem; overflow: visible; }
  .releases li { padding-right: 0.5rem; }
  .releases .year { font-size: 1.1rem; }
  .releases .rel { font-size: 0.8rem; }
}
