/*
 * Phosphor Grid — brutalist, terminal-flavored design system.
 *
 * One font (IBM Plex Mono), one accent (#00E67A), 1px #1C231E grid lines
 * partitioning every section. Border radius 0 everywhere, no shadows.
 * Shared borders: cells own their bottom/right edge only — never both
 * sides of the same line.
 */

:root {
  --bg: #050605;
  --panel: #10140F;
  --grid: #1C231E;
  --text-hi: #E4EFE8;
  --text: #B8C4BC;
  --text-body: #AEB9B2;
  --text-mid: #8A968E;
  --text-low: #7E8A82;
  --text-faint: #5A665E;
  --text-ghost: #3B453F;
  --accent: #00E67A;
  --accent-hover: #33FF9E;
  /* effect-only colors: chromatic-aberration glitch layers, never used as UI accents */
  --glitch-cyan: #00E0FF;
  --glitch-magenta: #FF2E9E;
  --on-accent: #050605;
  --row-title: #CDD8D1;
  --snap: background-color 120ms linear, color 120ms linear, border-color 120ms linear;

  /* legacy aliases still referenced by content styles */
  --bg-secondary: var(--panel);
  --bg-tertiary: #151A14;
  --text-secondary: var(--text-body);
  --text-muted: var(--text-faint);
  --border: var(--grid);
  --border-light: #2A332C;
  --code-bg: var(--panel);
  --code-border: var(--grid);
  --warning: #f1fa8c;
  --info: #8be9fd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  transition: var(--snap);
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ============================================
   Frame — the 1160px grid column
   ============================================ */

.pg-frame {
  max-width: 1160px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pg-frame > main {
  flex: 1;
}

/* ============================================
   Header nav
   ============================================ */

.pg-nav {
  display: grid;
  grid-template-columns: 1fr auto;
  border-bottom: 1px solid var(--grid);
}

.pg-nav-name {
  display: block;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-hi);
  border-right: 1px solid var(--grid);
  text-decoration: none;
}

.pg-nav-links {
  display: flex;
  flex-wrap: wrap;
}

.pg-nav-links a,
.pg-nav-links button {
  display: block;
  padding: 16px 22px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  border: none;
  border-right: 1px solid var(--grid);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: var(--snap);
}

.pg-nav-links a:hover,
.pg-nav-links button:hover {
  color: var(--text-hi);
}

.pg-nav-name:hover {
  text-shadow:
    -1px 0 0 var(--glitch-cyan),
    1px 0 0 var(--glitch-magenta);
}

.pg-nav-links form {
  display: contents;
}

.pg-nav-links .pg-nav-blog {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-right: none;
}

.pg-nav-links .pg-nav-blog:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* ============================================
   Section header strip — "NN / SECTION NAME"
   ============================================ */

.pg-section {
  border-bottom: 1px solid var(--grid);
}

.pg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--grid);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.pg-section-head a {
  color: var(--accent);
  text-decoration: none;
}

.pg-section-head a:hover {
  color: var(--accent-hover);
}

/* ============================================
   Glitch title — chromatic aberration (cyan × magenta)
   split layers behind big display text; static,
   horizontal offset only
   ============================================ */

.pg-glitch {
  text-shadow:
    -0.035em 0 0 var(--glitch-cyan),
    0.035em 0 0 var(--glitch-magenta);
}

/* ============================================
   Hero — the whole homepage, one screen
   ============================================ */

.pg-home {
  display: flex;
  flex-direction: column;
}

.pg-hero {
  min-height: calc(100svh - 55px);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--grid);
}

.pg-hero-main {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 40px 24px;
  overflow: hidden;
}

.pg-hero-art {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  user-select: none;
  pointer-events: none;
}

.pg-hero-art-canvas {
  overflow: hidden;
  font-family: inherit;
  font-size: clamp(7px, min(0.72vw, 1.15vh), 11px);
  line-height: 1.2;
  color: var(--accent);
}

.pg-hero-art-caption {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.pg-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 28px;
  text-transform: uppercase;
}

.pg-hero-main h1 {
  font-size: clamp(44px, min(11vw, 12vh), 136px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-hi);
  text-transform: uppercase;
}

.pg-hero-main h1 .accent {
  color: var(--accent);
}

.pg-btns {
  display: flex;
  gap: 1px;
  margin-top: 32px;
  background: var(--grid);
  border: 1px solid var(--grid);
  width: fit-content;
}

.pg-btn-primary,
.pg-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: var(--snap);
}

.pg-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pg-btn-logo {
  width: 34px;
  height: 34px;
  margin: -10px 0;
}

.pg-btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.pg-btn-primary:hover {
  background: var(--accent-hover);
}

.pg-btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.pg-btn-secondary:hover {
  color: var(--text-hi);
}

/* ============================================
   Roles strip — builder / author / contributor
   ============================================ */

.pg-roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--grid);
}

.pg-role {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--grid);
  text-decoration: none;
  transition: var(--snap);
}

.pg-role:last-child {
  border-right: none;
}

.pg-role:hover {
  background: var(--panel);
}

.pg-role-visual {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-bottom: 1px solid var(--grid);
  background: var(--panel);
  perspective: 900px;
}

.pg-role-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 20px 24px 24px;
}

.pg-role-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.pg-role-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.pg-role-link {
  margin-top: auto;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.pg-role:hover .pg-role-link {
  color: var(--accent-hover);
}

/* Phones: the Sproot plan and landing screens on two tilted handsets */
.pg-phone {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 150px;
  padding: 6px;
  margin-left: -40px;
  background: #0E110E;
  border: 1px solid #2A332C;
  border-radius: 24px;
  transform: rotateX(12deg) rotateY(-18deg) rotateZ(6deg);
  transition: transform 300ms ease;
}

.pg-phone.is-back {
  top: 46px;
  margin-left: -128px;
  transform: rotateX(12deg) rotateY(18deg) rotateZ(-7deg) translateZ(-40px);
}

.pg-phone img {
  display: block;
  width: 100%;
  border-radius: 18px;
}

.pg-role:hover .pg-phone {
  transform: rotateX(10deg) rotateY(-12deg) rotateZ(4deg) translateY(-10px);
}

.pg-role:hover .pg-phone.is-back {
  transform: rotateX(10deg) rotateY(14deg) rotateZ(-5deg) translateZ(-40px) translateY(-4px);
}

/* Books: the four volumes standing in a row, turned in 3D with page edges */
.pg-books {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.pg-book3d {
  --w: 104px;
  --h: 166px;
  --t: 16px;
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: var(--w);
  height: var(--h);
  margin-left: calc(-138px + var(--i) * 38px);
  transform-style: preserve-3d;
  transform: rotateY(-38deg) translateZ(calc(var(--i) * -56px));
  transition: transform 300ms ease;
  transition-delay: calc(var(--i) * 40ms);
}

.pg-book3d img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(calc(var(--t) / 2));
}

.pg-book3d::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: calc(var(--t) - 2px);
  height: calc(var(--h) - 6px);
  transform: translateX(calc(var(--w) - var(--t) / 2 - 3px)) rotateY(90deg) translateX(calc(var(--t) / 2));
  background: repeating-linear-gradient(90deg, #E9EDE9 0 1px, #C9D0CA 1px 2px);
}

.pg-book3d::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateZ(calc(var(--t) / -2));
  background: #0E110E;
}

.pg-role:hover .pg-book3d {
  transform: rotateY(-38deg) translateZ(calc(var(--i) * -56px)) translateY(-10px);
}

/* Diff: the real hunk from a merged upstream fix */
.pg-diff {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 32px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  font-size: 10px;
  transition: transform 300ms ease;
}

.pg-role:hover .pg-diff {
  transform: translateY(-6px);
}

.pg-diff-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grid);
  color: var(--text);
  letter-spacing: 0.04em;
}

.pg-diff-badge {
  padding: 2px 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.pg-diff-file {
  padding: 6px 10px;
  border-bottom: 1px solid var(--grid);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-diff-code {
  padding: 8px 0;
  line-height: 1.8;
  color: var(--text-low);
  overflow: hidden;
}

.pg-diff-code > div {
  padding: 0 10px;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-diff-code .is-add {
  background: rgba(0, 230, 122, 0.12);
  color: var(--accent);
}

/* ============================================
   04 / About
   ============================================ */

.pg-about-head {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 40px 24px;
  border-bottom: 1px solid var(--grid);
}

.pg-portrait {
  width: 112px;
  height: 112px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--grid);
  filter: grayscale(1) contrast(1.05);
}

.pg-about-name {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  text-transform: uppercase;
}

.pg-about-line {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-low);
}

.pg-facets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.pg-facet {
  padding: 28px 24px 32px;
  border-right: 1px solid var(--grid);
}

.pg-facet:last-child {
  border-right: none;
}

.pg-facet-title {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.pg-facet p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-low);
}

/* ============================================
   Chips + links (shared with blog)
   ============================================ */

.pg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.pg-chip {
  background: var(--panel);
  border: 1px solid var(--grid);
  padding: 4px 10px;
  color: var(--text-mid);
  text-transform: uppercase;
  text-decoration: none;
  transition: var(--snap);
}

a.pg-chip:hover {
  color: var(--accent);
}

.pg-accent-link {
  color: var(--accent);
  text-decoration: none;
}

.pg-accent-link:hover {
  color: var(--accent-hover);
}

/* ============================================
   Footer
   ============================================ */

.pg-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  text-transform: uppercase;
}

/* ============================================
   Blog index
   ============================================ */

.pg-blog-title {
  padding: 48px 24px;
  border-bottom: 1px solid var(--grid);
}

.pg-blog-title h1 {
  font-size: 38px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  text-transform: uppercase;
}

.pg-blog-title p {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-low);
  max-width: 520px;
}

.pg-filter-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--grid);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.pg-filter-strip .pg-chip {
  color: var(--accent);
}

.pg-post-row {
  display: block;
  padding: 28px 24px;
  border-bottom: 1px solid var(--grid);
}

.pg-post-row:last-child {
  border-bottom: none;
}

.pg-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.pg-post-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.pg-post-title a {
  color: var(--text-hi);
  text-decoration: none;
}

.pg-post-title a:hover {
  color: var(--accent);
}

.pg-post-excerpt {
  margin-top: 10px;
  max-width: 720px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-low);
}

.pg-post-actions {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.pg-post-actions a,
.pg-post-actions button {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: var(--snap);
}

.pg-post-actions a:hover,
.pg-post-actions button:hover {
  color: var(--accent-hover);
}

/* ============================================
   Article (post show)
   ============================================ */

.pg-article-head {
  padding: 48px 24px 40px;
  border-bottom: 1px solid var(--grid);
}

.pg-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.pg-article-meta .accent {
  color: var(--accent);
}

.pg-article-title {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-hi);
  text-transform: uppercase;
  max-width: 900px;
}

.pg-article-cover {
  margin-top: 32px;
}

.pg-article-cover img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--grid);
}

.pg-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.article-content {
  padding: 48px 24px;
  border-bottom: 1px solid var(--grid);
}

.article-content > * {
  max-width: 760px;
}

.article-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 48px 0 20px;
  color: var(--text-hi);
  text-transform: uppercase;
  border-bottom: 1px solid var(--grid);
  padding-bottom: 12px;
}

.article-content h2::before {
  content: '## ';
  color: var(--accent);
}

.article-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--text-hi);
  text-transform: uppercase;
}

.article-content h3::before {
  content: '### ';
  color: var(--accent);
}

.article-content p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 22px;
  color: var(--text-body);
}

.article-content ul,
.article-content ol {
  margin: 22px 0;
  padding-left: 24px;
}

.article-content li {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 8px;
  color: var(--text-body);
}

.article-content li::marker {
  color: var(--accent);
}

.article-content blockquote {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-left: 2px solid var(--accent);
  padding: 20px 24px;
  margin: 32px 0;
}

.article-content blockquote p {
  color: var(--text);
  margin-bottom: 0;
}

.article-content img {
  width: 100%;
  height: auto;
  border: 1px solid var(--grid);
  margin: 32px 0;
}

.article-content a {
  color: var(--text-hi);
  border-bottom: 1px solid var(--accent);
  text-decoration: none;
}

.article-content a:hover {
  color: var(--accent);
}

.article-content strong {
  color: var(--text-hi);
}

/* Content tables (markdown tables in posts) */

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 13px;
  border: 1px solid var(--grid);
}

.article-content table th,
.article-content table td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}

.article-content table th {
  color: var(--text-hi);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-content table td {
  color: var(--text-body);
}

/* ============================================
   Code blocks
   ============================================ */

pre {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  overflow-x: auto;
}

code {
  font-family: inherit;
}

/* Inline code */
.article-content code:not(pre code) {
  background: var(--panel);
  border: 1px solid var(--grid);
  color: var(--accent);
  padding: 2px 6px;
  font-size: 0.92em;
}

/* Kramdown/Rouge code block container */
.article-content [class^="language-"],
.article-content .highlighter-rouge {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  margin: 32px 0;
  padding: 20px 24px;
  overflow-x: auto;
}

.article-content .highlight {
  margin: 0;
}

/* Rouge line-number tables inside code blocks keep their own compact look */
.article-content .highlight table {
  width: auto;
  margin: 0;
  border: none;
}

.article-content .highlight table th,
.article-content .highlight table td {
  border-bottom: none;
  padding: 5px;
}

/* Hide scrollbars for code blocks */
.highlight pre {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.highlight pre::-webkit-scrollbar {
  display: none;
}

/* ============================================
   Rouge Syntax Highlighting (base16.dark)
   ============================================ */

.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight, .highlight .w {
  color: #d8d8d8;
}
.highlight .err {
  color: #181818;
  background-color: #ab4642;
}
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs {
  color: #585858;
}
.highlight .cp {
  color: #f7ca88;
}
.highlight .nt {
  color: #f7ca88;
}
.highlight .o, .highlight .ow {
  color: #d8d8d8;
}
.highlight .p, .highlight .pi {
  color: #d8d8d8;
}
.highlight .gi {
  color: #a1b56c;
}
.highlight .gd {
  color: #ab4642;
}
.highlight .gh {
  color: #7cafc2;
  background-color: #181818;
  font-weight: bold;
}
.highlight .ge {
  font-style: italic;
}
.highlight .ges {
  font-weight: bold;
  font-style: italic;
}
.highlight .gs {
  font-weight: bold;
}
.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
  color: #ba8baf;
}
.highlight .kc {
  color: #dc9656;
}
.highlight .kt {
  color: #dc9656;
}
.highlight .kd {
  color: #dc9656;
}
.highlight .s, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 {
  color: #a1b56c;
}
.highlight .sa {
  color: #ba8baf;
}
.highlight .sr {
  color: #86c1b9;
}
.highlight .si {
  color: #a16946;
}
.highlight .se {
  color: #a16946;
}
.highlight .nn {
  color: #f7ca88;
}
.highlight .nc {
  color: #f7ca88;
}
.highlight .no {
  color: #f7ca88;
}
.highlight .na {
  color: #7cafc2;
}
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
  color: #a1b56c;
}
.highlight .ss {
  color: #a1b56c;
}

/* ============================================
   Author box + article nav
   ============================================ */

.author-box {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 28px 24px;
  border-bottom: 1px solid var(--grid);
}

.author-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  border: 1px solid var(--grid);
  flex-shrink: 0;
}

.author-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-hi);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.author-bio {
  color: var(--text-low);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.author-box .pg-accent-link {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pg-article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--grid);
}

.pg-article-nav-cell {
  display: block;
  padding: 20px 24px;
  border-right: 1px solid var(--grid);
  text-decoration: none;
  transition: var(--snap);
}

.pg-article-nav-cell:last-child,
.pg-article-nav > :last-child {
  border-right: none;
}

.pg-article-nav-cell:hover {
  background: var(--panel);
}

.pg-article-nav-cell.is-next {
  text-align: right;
}

.pg-article-nav-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pg-article-nav-title {
  font-size: 13px;
  color: var(--row-title);
  line-height: 1.5;
}

.pg-article-nav-cell:hover .pg-article-nav-title {
  color: var(--accent);
}

.pg-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grid);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.pg-article-actions a,
.pg-article-actions button {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: var(--snap);
}

.pg-article-actions a:hover,
.pg-article-actions button:hover {
  color: var(--accent-hover);
}

/* ============================================
   Forms / auth pages
   ============================================ */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 64px 24px;
}

.auth-form {
  background: var(--bg);
  border: 1px solid var(--grid);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-form.wide {
  max-width: 900px;
}

.auth-title {
  margin-bottom: 28px;
  color: var(--text-hi);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--grid);
  border-radius: 0;
  background: var(--panel);
  color: var(--text-hi);
  font-family: inherit;
  font-size: 13px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
}

.btn,
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 14px 26px;
  border: 1px solid var(--grid);
  border-radius: 0;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: var(--snap);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.btn-secondary:hover {
  color: var(--text-hi);
  border-color: var(--border-light);
}

.auth-links {
  margin-top: 24px;
  font-size: 12px;
}

.link {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  color: var(--accent-hover);
}

.alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 12px;
  border: 1px solid var(--grid);
}

.alert-error {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

.alert-success {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   Toast notification
   ============================================ */

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--accent);
  padding: 14px 24px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
  z-index: 9999;
  animation: toast-in 0.15s linear, toast-out 0.15s linear 3.7s forwards;
  cursor: pointer;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1100px) {
  .pg-hero-main {
    grid-template-columns: 1fr;
  }

  .pg-hero-art {
    display: none;
  }
}

@media (max-width: 900px) {
  .pg-roles {
    grid-template-columns: 1fr;
  }

  .pg-role {
    border-right: none;
    border-bottom: 1px solid var(--grid);
  }

  .pg-role:last-child {
    border-bottom: none;
  }

  .pg-facets {
    grid-template-columns: 1fr;
  }

  .pg-facet {
    border-right: none;
    border-bottom: 1px solid var(--grid);
  }

  .pg-facet:last-child {
    border-bottom: none;
  }
}

@media (max-width: 600px) {
  .pg-btns {
    flex-direction: column;
    width: 100%;
  }

  .pg-about-head {
    align-items: flex-start;
    gap: 20px;
  }

  .pg-portrait {
    width: 80px;
    height: 80px;
  }

  .pg-about-name {
    font-size: 24px;
  }
  .pg-footer .hide-mobile {
    display: none;
  }

  .pg-article-nav {
    grid-template-columns: 1fr;
  }

  .pg-article-nav-cell {
    border-right: none;
    border-bottom: 1px solid var(--grid);
  }

  .pg-article-nav > :last-child {
    border-bottom: none;
  }

  .pg-article-nav-cell.is-next {
    text-align: left;
  }

  .pg-article-title {
    font-size: 24px;
  }

  .pg-footer {
    flex-direction: column;
    gap: 4px;
  }

  .auth-form {
    padding: 24px;
  }
}
