/* wilczynski-ai.dev — v1
   One stylesheet, no preprocessor, no build step, no webfont.
   Colours are all tokens: a six-month revisit should be an edit to :root, nothing more. */

:root {
  --bg:      #ffffff;
  --surface: #f7f8fa;
  --frame:   #eef0f4;
  --text:    #15181d;
  --muted:   #545b66;
  --accent:  #0a58ca;
  --accent-hover: #08429a;
  --border:  #dde1e7;

  --measure: 52rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #101318;
    --surface: #171b21;
    --frame:   #1c212a;
    --text:    #e9edf3;
    --muted:   #a2acba;
    --accent:  #85b4ff;
    --accent-hover: #adcdff;
    --border:  #2a3039;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* ---------- links ---------- */

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--accent);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

@media (min-width: 40em) {
  .wrap { padding: 4rem 2rem 4rem; }
}

.block { margin: 2.75rem 0 0; }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 { margin: 0 0 0.6rem; font-size: 1.15rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ---------- masthead ---------- */

.tagline {
  margin: 0.75rem 0 0;
  font-size: 1.125rem;
  color: var(--text);
  max-width: 40rem;
}

/* The Contact heading sits in the masthead, so it needs the space a .block would
   otherwise give it. It picks up the shared h2 styling. */
.masthead h2 { margin-top: 2.5rem; }

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1.0625rem;
}

/* With a heading above it, the list supplies its own spacing. */
.masthead h2 + .contact { margin-top: 0; }

/* ---------- projects: collapsible rows ----------
   Native <details>/<summary>. No JavaScript: the browser gives us the disclosure
   behaviour, keyboard operation and screen-reader semantics for free.
   Project links live OUTSIDE <details> so they stay reachable when collapsed —
   an <a> inside <summary> would both navigate and toggle. */

.proj {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 0.75rem;
}

.proj summary,
.proj-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.7rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
}

.proj summary {
  cursor: pointer;
  list-style: none;              /* Firefox */
}
.proj summary::-webkit-details-marker { display: none; }   /* Safari / older Chrome */

/* Chevron: an L-shaped corner rotated to point right when closed, down when open. */
.proj summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.proj > details[open] > summary::before { transform: rotate(45deg); }

.proj-name {
  margin: 0;
  font-size: 1.05rem;
}

.proj-topic {
  flex: 1 1 auto;
  font-size: 0.9375rem;
  color: var(--muted);
}

.proj-body {
  padding: 0 1.1rem 1.1rem;
}

/* Indent the body to line up with the summary text, past the chevron. */
@media (min-width: 34em) {
  .proj-body { padding-left: 2.25rem; }
}

.proj-links {
  margin: 0;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Says what the link is for. A bare domain under a collapsed row reads as a
   random link; "Open the live app: retail.wilczynski-ai.dev" does not. */
.link-lead {
  font-weight: 400;
  color: var(--muted);
}
.link-lead::after { content: ": "; }

/* A project with nothing to disclose renders as a plain row, no expander. */
.proj-plain .proj-head { padding-left: 1.1rem; }

.badge {
  display: inline-block;
  vertical-align: 0.15em;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-problem { color: var(--muted); }

.stack-line {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.note {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- screenshot slots ---------- */

.shots {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
}

@media (min-width: 46em) {
  .shots { grid-template-columns: repeat(3, 1fr); }
}

.shot { margin: 0; }

/* A screenshot is only ever emitted when the file exists and has alt text —
   tools/build.py refuses otherwise, so there is no placeholder state to style. */
.shot-img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--frame);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Each thumbnail links to the full-size copy - at grid size the screenshots read as
   shapes, not documents, and this is the only way to make them inspectable without
   JavaScript. */
.shot-link {
  display: block;
  border-radius: var(--radius);
}
.shot-link:hover .shot-img { border-color: var(--accent); }

.shot figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- lists ---------- */

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li { color: var(--muted); }

.stack-groups {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 34em) {
  .stack-groups { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 52em) {
  .stack-groups { grid-template-columns: repeat(3, 1fr); }
}

.stack-group h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.stack-group .plain-list { font-size: 0.9375rem; }

/* ---------- testimonial (renders only once the slot is uncommented) ---------- */

.testimonial {
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.testimonial footer { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--muted); }

/* ---------- footer ---------- */

.foot {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* This page ends up printed or PDF'd alongside a CV often enough to be worth 10 lines.
   Known limitation: a COLLAPSED <details> does not print its body — browsers hide it
   in the UA stylesheet and CSS cannot force it open. A collapsed project therefore
   prints as its summary row plus its links. Un-fixable without JavaScript; noted in
   TODO.md. Expanding a project before printing works around it. */
@media print {
  .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .proj, .testimonial { border: 1px solid #999; background: #fff; }
  .proj summary::before { border-color: #000; }
  a { color: #000; text-decoration: underline; }
  .proj-links a::after { content: " (" attr(href) ")"; font-weight: 400; }
}
