/* ==========================================================================
   LLAMMAG — neobrutalist stylesheet
   --------------------------------------------------------------------------
   Structure:
     1. Design tokens        — change the whole site from here
     2. Reset & base
     3. Typography
     4. Core components      — .card, .btn, .badge, .panel
     5. Layout               — header, footer, grids
     6. Page-specific        — hero, people, publications, codes
     7. Signature motif      — the spin lattice divider
     8. Responsive & a11y
   --------------------------------------------------------------------------
   The whole aesthetic is three rules applied consistently:
     border: var(--rule) solid var(--ink);
     box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
     border-radius: 0;
   ========================================================================== */

/* 1. DESIGN TOKENS ------------------------------------------------------- */

:root {
  /* Palette — magnet poles on paper */
  --paper:  #F6F1E5;   /* page background, warm cream          */
  --ink:    #14120F;   /* borders, text, shadows               */
  --north:  #FF4921;   /* magnet-pole reddish  — primary accent    */
  --south:  #23C4B4;   /* magnet-pole blueish — secondary accent  */
  --steel:  #E4DDCB;   /* muted panel fill                     */
  --white:  #FFFFFF;   /* card fill                            */

  /* Borders & shadows — the neobrutalist core */
  --rule:        3px;                 /* standard border width  */
  --rule-heavy:  4px;                 /* hero / major panels    */
  --shadow-x:    6px;
  --shadow-y:    6px;
  --shadow:      var(--shadow-x) var(--shadow-y) 0 var(--ink);
  --shadow-sm:   4px 4px 0 var(--ink);
  --shadow-north: var(--shadow-x) var(--shadow-y) 0 var(--north);
  --shadow-south: var(--shadow-x) var(--shadow-y) 0 var(--south);

  /* Type */
      --font-display: "Space Grotesk", system-ui, sans-serif;
      --font-body:    "Inter", system-ui, sans-serif;
      --font-mono:    "IBM Plex Mono", ui-monospace, monospace;
    
      /* Spacing scale */
      --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2.5rem;
  --s5: 4rem;

  --content-width: 68rem;
}

/* 2. RESET & BASE -------------------------------------------------------- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

::selection { background: var(--north); color: var(--paper); }

/* 3. TYPOGRAPHY ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s2);
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--s2); max-width: 65ch; }

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--north); }

code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

/* Eyebrow label: [ SECTION ] in mono, used above headings */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 0.25rem 0.6rem;
  margin-bottom: var(--s2);
}
.eyebrow--north { background: var(--north); }
.eyebrow--south { background: var(--south); color: var(--white); }

/* 4. CORE COMPONENTS ------------------------------------------------------ */

/* The card: the workhorse. Everything boxed on the site is a .card. */
.card {
  background: var(--white);
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow);
  padding: var(--s3);
}

.card--flat   { box-shadow: none; }
.card--steel  { background: var(--steel); }
.card--north  { background: var(--north); color: var(--paper); }
.card--south  { background: var(--south); color: var(--white); }

/* Hover-lift: cards that are links move toward their shadow */
a.card, .card--link {
  display: block;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
a.card:hover, .card--link:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  background: var(--white);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}
.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
}
.btn:active { transform: translate(4px, 4px); box-shadow: none; }

.btn--primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-north); }
.btn--primary:hover { color: var(--paper); box-shadow: 2px 2px 0 var(--north); }

/* Badges / tags */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border: 2px solid var(--ink);
  background: var(--steel);
}
.badge--north { background: var(--north); color: var(--paper); }
.badge--south { background: var(--south); color: var(--white); }

/* 5. LAYOUT --------------------------------------------------------------- */

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--s2);
}

/* Header */
.site-header {
  border-bottom: var(--rule) solid var(--ink);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding-top: var(--s2);
  padding-bottom: var(--s2);
  flex-wrap: wrap;
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  border: var(--rule) solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 0.3rem 0.8rem;
}
.site-logo:hover { color: var(--ink); transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--ink); }
.site-logo .pole { color: var(--north); }

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.uta-logo img {
  height: 50px;
  width: auto;
  display: block;
}

.site-nav { display: flex; gap: var(--s1); flex-wrap: wrap; }
.site-nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
}

/* Footer */
.site-footer {
  margin-top: var(--s5);
  border-top: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.site-footer .wrap {
  padding-top: var(--s3);
  padding-bottom: var(--s3);
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--north); }

/* Grids */
.grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: var(--s3) 0;
}

.section { margin: var(--s4) 0; }

/* 6. PAGE-SPECIFIC -------------------------------------------------------- */

/* Hero */
.hero {
  margin: var(--s4) 0;
  border: var(--rule-heavy) solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  background: var(--white);
  padding: var(--s4);
}
.hero h1 { margin-bottom: var(--s2); }
.hero .lede {
  font-size: 1.1rem;
  max-width: 46ch;
}
.hero .actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }

/* People */
.person-card h3 { margin-bottom: 0.2rem; }
.person-role {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--south);
  font-weight: 600;
  margin-bottom: var(--s1);
}
.person-links { display: flex; gap: var(--s1); flex-wrap: wrap; margin-top: var(--s2); }

/* Publications: a dense bordered list, not cards */
.pub-list { list-style: none; margin: var(--s3) 0; padding: 0; border: var(--rule) solid var(--ink); box-shadow: var(--shadow); background: var(--white); }
.pub-list li {
  padding: var(--s2) var(--s3);
  border-bottom: 2px dashed var(--ink);
}
.pub-list li:last-child { border-bottom: none; }
.pub-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.pub-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 0.25rem;
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  align-items: center;
}
.pub-authors { font-size: 0.9rem; margin-top: 0.15rem; }

/* Codes */
.code-card .lang { float: right; }
.code-card h3 a { text-decoration: none; }
.code-card h3 a:hover { color: var(--north); text-decoration: underline; }

/* Prose pages (research articles etc.) */
.prose { max-width: 46rem; }
.prose h2 { margin-top: var(--s4); }
.prose blockquote {
  margin: var(--s3) 0;
  padding: var(--s2) var(--s3);
  border: var(--rule) solid var(--ink);
  border-left-width: 10px;
  background: var(--steel);
  font-style: italic;
}
.prose pre {
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: var(--s2);
  overflow-x: auto;
  font-size: 0.85rem;
}
.prose table {
  border-collapse: collapse;
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow-sm);
  background: var(--white);
}
.prose th, .prose td { border: 2px solid var(--ink); padding: 0.5rem 0.8rem; }
.prose th { background: var(--ink); color: var(--paper); font-family: var(--font-display); }

.giallo-l {
    display: inline-block;
    min-height: 1lh;
    width: 100%;
}
.giallo-ln {
    display: inline-block;
    user-select: none;
    margin-right: 0.4em;
    padding: 0.4em;
    min-width: 3ch;
    text-align: right;
    opacity: 0.8;
}

/* 7. SIGNATURE MOTIF: the spin lattice ------------------------------------ */
/* A strip of alternating ↑↓ spins. Pure text, no images.
   Use <div class="spins" aria-hidden="true"></div> between sections. */

.spins {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.55em;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  color: var(--ink);
  margin: var(--s4) 0;
  text-align: center;
}
.spins::before { content: "↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓"; }
.spins--saturated { color: var(--north); }
.spins--saturated::before { content: "↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"; }

/* 8. RESPONSIVE & ACCESSIBILITY ------------------------------------------- */

@media (max-width: 40rem) {
  :root { --shadow-x: 4px; --shadow-y: 4px; }
  .hero { padding: var(--s3); box-shadow: 6px 6px 0 var(--ink); }
  .site-header .wrap { justify-content: center; }
}

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

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