/* City in the Rain — site stylesheet
   Soft "neumorphic" look: one background colour, raised and pressed
   surfaces made with paired light/dark shadows. Light and dark themes
   follow the visitor's system setting. */

:root {
  --bg: #f0f4f5;
  --fg: #2d3436;
  --muted: #5d6a6d;
  --shadow-light: rgba(255, 255, 255, 0.8);
  --shadow-dark: rgba(174, 174, 192, 0.45);
  --accent: #007373;        /* teal, for links */
  --accent-hover: #b36b00;  /* amber, for hover */
  --vs: #b3261e;            /* howtoscr: Visual Studio specific */
  --ogl: #3047b8;           /* howtoscr: OpenGL specific */
  --radius: 15px;
  --measure: 42rem;
  --raised: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  --raised-sm: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
  --pressed: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202428;
    --fg: #eef1f2;
    --muted: #a9b3b6;
    --shadow-light: rgba(55, 65, 70, 0.35);
    --shadow-dark: rgba(10, 15, 20, 0.7);
    --accent: #3fd0d0;
    --accent-hover: #ffca28;
    --vs: #ff8a80;
    --ogl: #9fa8ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent-hover); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.2; margin: 2rem 0 0.75rem; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-top: 0.5rem; text-shadow: 1px 1px 2px var(--shadow-dark); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

hr { border: 0; height: 6px; border-radius: 3px; box-shadow: var(--pressed); margin: 2.5rem 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  box-shadow: 0 4px 12px var(--shadow-dark);
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.logo:hover { color: var(--accent-hover); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.site-nav a {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  box-shadow: var(--raised-sm);
  color: var(--fg);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent-hover); }
.site-nav a[aria-current="page"] { box-shadow: var(--pressed); color: var(--accent); }

/* ---------- Layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 3rem;
}

.prose { max-width: var(--measure); }
.prose p, .prose li { max-width: var(--measure); }

.lede { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.byline { color: var(--muted); margin-top: -0.25rem; font-style: italic; }
.note { color: var(--muted); font-size: 0.95rem; }

.card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--raised);
  padding: 1.5rem 1.75rem;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.inset { box-shadow: var(--pressed); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.75rem;
  margin: 1.5rem 0 2.5rem;
}
.cards.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 36rem) { .cards.two-up { grid-template-columns: 1fr; } }
.cards .card h3 { margin-top: 0; }
.cards .card h3 a { color: var(--fg); text-decoration: none; }
.cards .card h3 a:hover { color: var(--accent-hover); }
.cards .card p { margin: 0.4rem 0 0; color: var(--muted); }

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--raised);
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
  margin: 0 0.75rem 0.9rem 0;
}
.btn:hover { color: var(--accent-hover); }
.btn:active { box-shadow: var(--pressed); }
.btn.primary { color: var(--accent); }

.page-nav { margin-top: 3rem; }

.placeholder {
  border: 2px dashed var(--muted);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: var(--muted);
}

/* ---------- Home page ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: 3.5rem;
}
.hero .hello { font-size: 1.15rem; font-weight: 500; margin: 0; color: var(--muted); }
.hero h1 { font-size: clamp(2.75rem, 8vw, 4.5rem); margin: 0.1rem 0 0.4rem; }
.hero h1 .accent { color: var(--accent); }
.hero .tagline { font-size: 1.3rem; margin: 0 0 1.5rem; color: var(--muted); }
.hero blockquote { margin: 0 0 2rem; padding: 1.25rem 1.5rem; border-radius: var(--radius); box-shadow: var(--pressed); max-width: 34rem; }
.hero blockquote p { margin: 0; }
.hero blockquote footer { margin-top: 0.6rem; color: var(--muted); font-style: italic; }
.hero-heading { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-shadow: none; margin: 0 0 1rem; }
.btn + .hero-heading { margin-top: 0.9rem; }
.hero-side { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.hero-side .btn { margin: 0; }
.hero-figure { justify-self: center; margin: 0; padding: 0.8rem; border-radius: var(--radius); box-shadow: var(--raised); }
.hero-figure img { display: block; border-radius: 10px; width: 100%; max-width: 340px; height: auto; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0 0 0.6rem; }

@media (max-width: 44rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { order: -1; }
  .hero-figure { max-width: 200px; }
}

/* ---------- Writing ---------- */

.verse {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 1.5rem 0;
}
.voice { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: 0.95em; }
.side-by-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2rem; }

.work-list { margin: 1rem 0 2rem; max-width: var(--measure); }
.work-list dt { font-weight: 700; margin-top: 1.1rem; }
.work-list dd { margin: 0.15rem 0 0; color: var(--muted); }
.work-list.plain { columns: 2 14rem; list-style: none; padding: 0; }
.work-list.plain li { margin: 0 0 0.5rem; break-inside: avoid; }

.prose blockquote { margin: 1rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 4px solid var(--shadow-dark); }

/* Inline spoiler: blacked out until hovered, or clicked/tapped/tabbed to.
   Usage: <span class="spoiler" tabindex="0">hidden text</span>
   tabindex="0" is what makes click, tap and keyboard focus reveal it;
   it stays revealed until focus moves elsewhere. No JavaScript needed. */
.spoiler {
  background: var(--fg);
  color: transparent;
  border-radius: 4px;
  padding: 0 0.2em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.spoiler a { color: transparent; }
.spoiler:hover, .spoiler:focus, .spoiler:focus-within {
  background: transparent;
  color: inherit;
  box-shadow: var(--pressed);
  cursor: auto;
}
.spoiler:hover a, .spoiler:focus a, .spoiler:focus-within a { color: var(--accent); }

/* ---------- Code (How to Scr) ---------- */

pre, code { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: 0.9rem; }
pre { padding: 1rem 1.25rem; border-radius: var(--radius); box-shadow: var(--pressed); overflow-x: auto; line-height: 1.5; }
.vs { color: var(--vs); }
.ogl { color: var(--ogl); }

table { border-collapse: collapse; margin: 1rem 0; }
td, th { padding: 0.35rem 1rem 0.35rem 0; vertical-align: top; text-align: left; }

/* ---------- Pictures ---------- */

.figure { margin: 2rem 0; }
.figure img { display: block; border-radius: 10px; box-shadow: var(--raised); }
.figure figcaption { margin-top: 0.75rem; color: var(--muted); max-width: var(--measure); }
.figure figcaption b, .figure figcaption strong { color: var(--fg); }

.with-portrait { display: flow-root; }
.portrait { float: right; margin: 2rem 0 1rem 1.5rem; padding: 0.5rem; border-radius: var(--radius); box-shadow: var(--raised); }
.portrait img { display: block; border-radius: 10px; width: 150px; height: auto; }
@media (max-width: 30rem) { .portrait img { width: 110px; } }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
  padding: 0;
  list-style: none;
}
.gallery a { display: block; padding: 0.5rem; border-radius: var(--radius); box-shadow: var(--raised-sm); }
.gallery a:hover { box-shadow: var(--pressed); }
.gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

.cast { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.5rem; align-items: center; max-width: var(--measure); }
.cast img { border-radius: 10px; box-shadow: var(--raised-sm); }

.comic { margin: 2rem 0 3rem; }
.comic h3 { margin-bottom: 1rem; }
.comic img { display: block; border-radius: 6px; background: #fff; padding: 6px; box-shadow: var(--raised); }

.video { margin: 1.5rem 0 2rem; padding: 0.6rem; border-radius: var(--radius); box-shadow: var(--raised); }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }

/* ---------- Quotes ---------- */

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.75rem; }
.quote { margin: 0; }
.quote blockquote { margin: 0; }
.quote blockquote p { margin: 0 0 0.6rem; }
.quote figcaption { color: var(--muted); font-style: italic; }
.quote figcaption::before { content: "— "; }

/* ---------- 404 ---------- */


/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer a { color: var(--muted); }

.card .thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin-bottom: 1rem; }
