/* ==========================================================================
   console.css — site3: Compy.
   A light, modern, professional layout. NOT a terminal: clean sans type, with
   monospace used only where it's literal — the typed commands Compy runs.

   PALETTE IS UNDECIDED. Colours are tokens, kept restrained and colour-blind-
   friendly (no meaning rests on red vs green). Swap freely (e.g. to brighter primary tones).
   Mono is decided: Ubuntu Mono, Compy's real terminal font, for code only.
   ========================================================================== */

:root {
  --bg:     #ffffff;
  --bg-soft:#f6f8fb;
  --ink:    #15243c;   /* navy — headings */
  --text:   #3a4658;   /* body */
  --muted:  #69748a;
  --faint:  #97a0b0;
  --line:   #e7ebf2;

  --accent: #0f9e80;   /* Compy green — the 'y', accents */
  --link:   #0b7a63;   /* darker green, readable on white */
  --amber:  #9a6b12;   /* numbers/quantities */
  --accent-bg:   #f3faf7;  /* faint green wash, e.g. the highlights box */
  --accent-line: #d8ede4;

  /* Brand marks only (the logotype): the real Compy palette. Kept off the
     functional UI, whose accents stay muted/colour-blind-safe. */
  --brand-blue:  #0021dc;  /* the "Comp" wordmark */
  --brand-green: #0fe9a0;  /* the mascot "y" */

  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Ubuntu Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 40rem;
  --wide: 64rem;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #d7f1e8; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: 1.4rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ext::after { content: " \2197"; color: var(--faint); font-size: 0.85em; }

/* --- Header --- */
.site-header { border-bottom: 1px solid var(--line); }
.head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem;
  max-width: var(--wide); margin-inline: auto; padding: 0.9rem 1.4rem;
}
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
/* the real Compy wordmark (Comp + mascot 'y'), straight from the brand art */
.brand .brand-word { height: 1.6rem; width: auto; display: block; }
.tag { color: var(--faint); font-size: 0.9rem; }
.head nav { margin-left: auto; display: flex; gap: 1.3rem; font-size: 0.95rem; font-weight: 500; }
.head nav a { color: var(--muted); }
.head nav a:hover { color: var(--ink); text-decoration: none; }

/* --- Sections --- */
section { padding-block: clamp(2.6rem, 6vw, 4.4rem); }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.eyebrow {
  font-family: var(--display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
h1, h2, h3 { font-family: var(--display); color: var(--ink); letter-spacing: -0.025em; line-height: 1.15; }
h1 { font-weight: 700; font-size: clamp(2.1rem, 5.5vw, 3.1rem); }
.p { font-weight: 600; font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 0.3rem; }
h3 { font-weight: 600; font-size: 1.05rem; }
p { max-width: var(--measure); }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.95rem; }
.lead { color: var(--text); }

/* --- Hero: the first section lives inside the Compy console screen --- */
.hero { padding-top: clamp(1.8rem, 5vw, 3.2rem); }
/* the actual startup.png as the screen: grey canvas fills above, its console
   bar pinned to the bottom edge (container is width-capped, so it scales cleanly) */
.screen {
  border: 1px solid #c7ced8; overflow: hidden;
  background: #bfbfbf url(../img/startup.png) no-repeat bottom center;
  background-size: 100% auto;
}
/* bottom padding clears the console bar: its top is 6.54% of the image width
   from the bottom, and % padding tracks width, so this scales at any size */
.screen__canvas { padding: clamp(1.6rem, 4.5vw, 3.2rem); padding-bottom: calc(7% + 1rem); }
.hero h1 { max-width: 18ch; }
.hero p { font-size: 1.2rem; color: var(--text); margin-top: 1.1rem; max-width: 54ch; }
.hero .lead { color: var(--ink); }
/* the highlights read as a panel sitting on the screen — kept compact */
.hero .highlights { background: rgba(255, 255, 255, 0.58); border-color: rgba(21, 36, 60, 0.1); padding-block: 0.85rem; gap: 0.32rem; }

/* --- Highlights box (in the hero) --- */
.highlights {
  list-style: none; padding: 1.1rem 1.3rem; margin-top: 1.7rem;
  border: 1px solid var(--accent-line); background: var(--accent-bg);
  border-radius: var(--radius); max-width: var(--measure);
  display: grid; gap: 0.5rem;
}
.highlights li { position: relative; padding-left: 1.4rem; color: var(--text); }
.highlights li::before {
  content: ""; position: absolute; left: 0.3rem; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* --- Exercises: each is a small game — a titled box with a picture --- */
.run-intro { margin-top: 0.5rem; }
.runs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 1.6rem; }
@media (max-width: 640px) { .runs { grid-template-columns: 1fr; } }
.run {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.run:hover { border-color: #cfe6dd; box-shadow: 0 8px 24px rgba(21,36,60,0.07); transform: translateY(-2px); }
/* the run command, styled as the box's title */
.run__title { font-family: var(--mono); font-weight: 700; font-size: 1.06rem; color: var(--ink); padding: 0.85rem 1.15rem 0.7rem; }
.run__title .kw { color: var(--muted); font-weight: 400; }
.run__title .str { color: var(--accent); }
/* the picture — what you actually see (or hold) when you run it */
.run .shot { aspect-ratio: 16 / 10; background: #eef1f5; border-block: 1px solid var(--line); overflow: hidden; }
.run .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.run__body { padding: 0.85rem 1.15rem 1.05rem; }
.run .what { display: block; color: var(--text); }
.run .concept { display: block; margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }

/* numbers/quantities, picked out as in Compy's own code colouring */
.num { color: var(--amber); }
code { font-family: var(--mono); font-size: 0.9em; color: var(--ink); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 0.06em 0.36em; }
kbd { font-family: var(--mono); font-size: 0.85em; color: var(--ink); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0.05em 0.4em; }

/* --- The arc --- */
.arc { list-style: none; padding: 0; margin-top: 1rem; display: grid; gap: 0; max-width: var(--measure); }
.arc li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--line); color: var(--text); }
.arc li:last-child { border-bottom: 1px solid var(--line); }
.arc li b { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.arc li i { color: var(--muted); font-style: normal; }

/* --- Open --- */
.open .src { margin-top: 1.1rem; }
.open .repo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.98rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1rem;
  color: var(--link); background: var(--bg);
}
.open .repo:hover { border-color: #cfe6dd; text-decoration: none; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--line); }
.foot {
  max-width: var(--wide); margin-inline: auto; padding: 1.6rem 1.4rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem;
  color: var(--faint); font-size: 0.9rem;
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .foot-mark { height: 1.5em; width: auto; transform: translateY(0.35em); margin-right: 0.1rem; }

/* current page in the top nav */
.head nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--accent); padding-bottom: 1px; }
/* divider before the philosophy link — it's a separate page */
.head nav .nav-sep { color: var(--faint); user-select: none; }

/* --- Principle cards (the philosophy page) --- */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 640px) { .principles { grid-template-columns: 1fr; } }
.principle { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.principle h3 { margin-bottom: 0.4rem; }
.principle p { color: var(--muted); font-size: 0.95rem; max-width: none; }

/* --- Accessibility --- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: #fff; padding: 0.4rem 0.8rem; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .run { transition: none; } }
