/*
 * Zine port of the Sphinx/Shibuya styling, following docs/_static/custom.css:
 *   light: cream background #f3f1ea, ink text #3d3929, headings #535146
 *   dark:  #111 background (matching zine's own default), #e5e5e2 text
 *   accent ("citron"): #cccc49, from the Radix scale in
 *   css/citron-radix-scale-pinned.css (swap the link in base.shtml for
 *   css/citron-radix-scale.css to get the brighter #eeec00 step 9).
 *   secondary violet #8373ca
 * Light-first, with dark mode via prefers-color-scheme.
 */

/*
 * Font set matched to the Zine website and its docs (https://zine-ssg.io/):
 * Bebas Neue for display/headings (h1-h3), Merriweather for body text,
 * JetBrains Mono for code. Bebas Neue is an all-caps face, so "Scott Huberty"
 * renders as "SCOTT HUBERTY" like their "Zine" wordmark. All files vendored
 * from zine-ssg.io/fonts/ (zine-ssg.io also links a Fira Code stylesheet, but
 * no rule there actually uses it, so it is not included).
 *
 * Licenses: Bebas Neue (c) Dharma Type, Merriweather (c) Sorkin Type,
 * JetBrains Mono (c) JetBrains — all SIL Open Font License 1.1.
 */
@font-face {
  font-family: 'Bebas Neue';
  src: url('../fonts/BebasNeue-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-Light.ttf') format('truetype');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-Black.ttf') format('truetype');
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/Merriweather-BlackItalic.ttf') format('truetype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jbm/JetBrainsMono-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jbm/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jbm/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jbm/JetBrainsMono-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jbm/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Accent roles mapped onto the citron Radix scale:
     step 9 solid, step 11 readable text, alpha steps soft washes. */
  --accent: var(--citron-9);
  --accent-strong: var(--citron-11);
  --accent-alt: #8373ca;
  --accent-soft: var(--citron-a3);

  --bg: #f3f1ea;
  --bg-raised: #faf9f3;
  --text: #3d3929;
  --text-muted: #7c7562;
  --heading: #535146;
  --border: rgba(61, 57, 41, 0.14);
  --shadow: 0 1px 2px rgba(61, 57, 41, 0.06), 0 8px 24px rgba(61, 57, 41, 0.07);

  --radius: 12px;
  --content-width: 44rem;
  --site-width: 68rem;

  --font-body: 'Merriweather', Georgia, serif;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* The citron scale gates its dark values behind a .dark class; this site
       keys dark mode off prefers-color-scheme, so bridge the steps we use. */
    --citron-9: #cccc49;
    --citron-10: #c2c13c;
    --citron-11: #dcdd5c;
    --citron-12: #f0f2b6;
    --citron-a4: #fbfb3325;

    --accent: var(--citron-9);
    --accent-strong: var(--citron-11);
    --accent-alt: #a194e0;
    --accent-soft: var(--citron-a4);

    --bg: #111111;
    --bg-raised: #373636;
    --text: #e5e5e2;
    --text-muted: #a8a59c;
    --heading: #ffffff;
    --border: rgba(229, 229, 226, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

/* Zine emits width/height attributes for local images; browsers distort
   images with fixed dimensions when they resize. */
img {
  height: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--citron-12);
}

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

::selection {
  /* the violet of the "Phase 1" note admonition (--accent-alt) */
  background: var(--accent-alt);
  color: var(--citron-contrast);
}

/* Like zine-ssg.io, h1-h3 render in the capitalised Bebas Neue display face. */
h1,
h2,
h3 {
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
}

/* h4 stays in the body face, as on zine-ssg.io. */
h4 {
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

h2 {
  font-size: 1.5rem;
  margin-top: 1.75em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--citron-contrast);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--heading);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand .logo img {
  width: 44px;
  height: 44px;
  display: block;
}

.brand-name {
  /* Same display face as the hero title / zine's wordmark; Bebas is caps-only,
     so "Scott Huberty" renders as "SCOTT HUBERTY". */
  font-family: var(--font-display);
  font-weight: normal;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ------------------------------------------------------------------ hero */

main {
  display: block;
}

.hero {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.hero-logo img {
  width: 110px;
  height: 110px;
}

/* Same font + weight as the "Zine" hero on https://zine-ssg.io/ */
.hero h1 {
  font-family: var(--font-display);
  font-weight: normal;
  font-size: clamp(2.75rem, 7vw, 4rem);
  letter-spacing: 0.02em;
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0.25rem 0 1.25rem;
}

.hero .lead code {
  font-family: var(--font-mono);
  font-size: 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4em 0.8em;
  color: var(--accent-alt);
  white-space: pre-wrap;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-strong);
  background: transparent;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--citron-contrast);
}

.button-primary:hover {
  background: var(--citron-10);
  color: var(--citron-contrast);
}

/* --------------------------------------------------------------- content */

.contents,
.content,
.page-header,
article {
  max-width: var(--site-width);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.contents {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 120ms ease, border-color 120ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-title {
  display: block;
  font-weight: 650;
  color: var(--heading);
}

.card-description {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.page-header {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 1.5rem;
}

/* Page titles centered like zine-ssg.io/community's title, wearing the dashed
   rule their headings get (zine-ssg.io/log/ "About"), spanning the text column. */
.page-header h1 {
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
  border-bottom: 1px dashed #aaa;
}

.content {
  max-width: calc(var(--content-width) + 3rem);
  padding-bottom: 3rem;
}

.content > h2:first-child,
.content > h3:first-child {
  margin-top: 1em;
}

.content p {
  margin: 0 0 1.15em;
}

.content ul,
.content ol {
  padding-left: 1.35rem;
}

.content li {
  margin-bottom: 0.5em;
}

.content img {
  display: block;
  max-width: min(30rem, 100%);
  margin: 1.5rem auto;
  border-radius: var(--radius);
}

.content figure {
  margin: 1.5rem 0;
}

.content figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: -0.5rem;
}

.content code {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
  font-family: var(--font-mono);
}

/* Admonition-style blocks (SuperMD $block) */

.content .block {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

/* The Bio page's tip block borrows the warning admonition from
   https://zine-ssg.io/'s index (dashed #CCCC49 box with a filled #CCCC49
   title bar in the display face), keeping its own "Tip" label. */
.content .block.tip {
  background: transparent;
  border: 1px dashed var(--accent);
  border-radius: 0;
  padding: 0 0 0.75rem;
}

.content .block.tip h2 {
  font-size: 1.17em;
  margin: 0;
  padding: 2px 15px 0;
  text-align: left;
  color: #111111;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.content .block.tip p {
  padding: 0 15px;
  font-size: 0.9em;
}

.content .block.note {
  background: var(--bg-raised);
  border-color: transparent;
  border-left-color: var(--accent-alt);
}

.content .block p:last-child {
  margin-bottom: 0;
}

/* Portfolio figure grids (raw HTML blocks) */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
  clear: both;
}

.portfolio-item {
  position: relative;
  margin: 0;
  padding: 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform 120ms ease, border-color 120ms ease;
}

.portfolio-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.portfolio-item a {
  text-decoration: none;
}

/* Stretch each link's hit area over the whole card, so clicking anywhere on
   the card follows it (image, caption, or padding). */
.portfolio-item a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.portfolio-item img {
  display: block;
  max-width: 100%;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  border-radius: 8px;
  /* white tile keeps dark-ink logos readable in dark mode */
  background: #ffffff;
  padding: 0.55rem;
}

.portfolio-item figcaption {
  font-weight: 550;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Vector plot embed */

.vector-plot {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.vector-plot iframe {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .hero {
    padding-top: 2.5rem;
  }

  .hero .lead {
    font-size: 1rem;
  }
}