/* ===================================================
   adamdaniel.ai — Cobalt Thermal Design System
   =================================================== */

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

:root {
  --bg-0: #04060f;
  --bg-1: #060d1f;
  --bg-2: #0a1530;
  --bg-3: #111e40;
  --accent: #285aff;
  /* --accent is 3.4-3.9:1 on --bg-0..--bg-2, fine for borders and large
     shapes but under AA (4.5:1) for 12px text. Small accent TEXT uses this
     lighter blue: 5.85:1 on --bg-0, 5.60:1 on --bg-1, 5.22:1 on --bg-2. */
  --accent-text: #5a82ff;
  --accent-dim: #1a3abf;
  --accent-glow: rgb(40 90 255 / 28%);
  --text-primary: #d8e4ff;
  --text-secondary: #c8d4f0;
  --text-dim: #8ab0e8;
  --text-bright: #fff;
  --border: #1a2a5e;
  --border-bright: #2a3a7e;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --sans: 'Helvetica Neue', 'Arial', sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --transition: 0.2s ease;
  /* The sticky .site-header is 3.5rem tall (2rem padding, one 0.9rem * 1.6
     line of logo, 1px rule) at every width; one more rem keeps a focus ring
     clear of it. */
  --site-header-offset: 4.5rem;
}

html, body {
  height: 100%;
}

/* A focus-induced scroll (Shift+Tab up a long page), scrollIntoView and a
   #fragment jump (skip link, heading anchors) otherwise leave the target
   under the sticky header (WCAG 2.4.11 Focus Not Obscured). */
html {
  scroll-padding-top: var(--site-header-offset);
}

body {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-secondary);
  font-family: var(--sans);
  line-height: 1.6;
  animation: thermal 40s ease-in-out infinite alternate;
}

@keyframes thermal {
  0%   { background-color: #04060f; }
  50%  { background-color: #060d1f; }
  100% { background-color: #03040c; }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, var(--accent-glow), transparent 70%);
  animation: warmth 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes warmth {
  0% {
    opacity: 0.05;
    transform: scale(0.7);
  }

  100% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

@keyframes text-thermal {
  0%   { color: var(--text-dim); }
  100% { color: var(--text-primary); }
}

@keyframes border-thermal {
  0%   { border-color: var(--text-dim); }
  100% { border-color: var(--text-primary); }
}

/* ── Typography ─────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 200;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

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

a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

a:hover, a:focus-visible {
  color: var(--text-bright);
  border-bottom-color: var(--text-bright);
}

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

code, pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

code {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.15em 0.4em;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* A long URL or identifier has no break opportunity, so it widens the whole
   page (#753). `break-word` breaks only a string that would otherwise
   overflow its line. Unlike `anywhere` it leaves min-content size alone, so a
   table's auto layout (a bare Markdown table, a classed one such as
   .bws-table) is computed exactly as before: no cell breaks mid-word while the
   table fits, and a wide table still scrolls in its own box. `pre` never wraps
   (white-space: pre), so a code block keeps its horizontal scroll. */
.post-content,
.post-excerpt,
:not(pre) > code {
  overflow-wrap: break-word;
}

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-dim);
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* A fixed-width embed must not push the page sideways on a phone. Frames
   without both dimensions keep their authored height (for interactive tools). */
iframe {
  box-sizing: border-box;
  max-width: 100%;
}

/* Fixed-size video embeds default to 16:9 and scale their height with width.
   Authors can override aspect-ratio inline for a different content format. */
iframe[width][height] {
  height: auto;
  aspect-ratio: 16 / 9;
}

/* A Markdown table is a bare <table> (kramdown emits no class), so it has no
   box of its own and a wide one widens the whole document. Make it its own
   horizontal scroll box. `:not([class])` leaves a table an author or site
   already styled alone: `width: 100%` on a `display: block` table would
   shrink-wrap its columns instead of filling the row. */
table:not([class]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

/* Readable defaults for that same bare table (#729): kramdown's output has no
   padding or borders, so "1,450 ms" ran into "slow & thorough". Same
   `:not([class])` scope, so a classed table (adamdaniel.ai's .bws-table) keeps
   its own cell styling. Cell alignment from a Markdown `:---:` row is an inline
   style and still wins over the `text-align` here. */
table:not([class]) th,
table:not([class]) td {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table:not([class]) th {
  background: var(--bg-2);
  border-bottom-color: var(--border-bright);
  color: var(--text-bright);
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Layout ─────────────────────────────────────── */

.site-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.container--wide {
  max-width: 1100px;
}

main {
  flex: 1;
  padding: 4rem 0;
}

/* ── Site Header ────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Solid, not translucent: at 85% with a blur the scrolled post's date line
     and title ghosted through the brand and nav (clear in WebKit at phone
     width, where the backdrop blur does not hold up). The token is the page
     background, so the header looks the same over empty space. */
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  border: none;
}

.site-logo:hover {
  color: var(--text-bright);
  border: none;
}

.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.site-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--mono);
  border: none;
  color: var(--text-dim);
  animation: text-thermal 8s ease-in-out infinite alternate;
}

.site-nav a:hover {
  color: var(--text-bright);
  border: none;
}

/* Current section (#737). The base `.site-nav a` rule runs the text-thermal
   animation, and a running animation outranks every normal declaration, so a
   plain `color` here never showed: the old `.active` rule was inert. The state
   has to switch the animation off. The underline is text-decoration, not a
   border plus padding, so marking a link moves nothing around it. */
.site-nav a.active,
.site-nav a[aria-current="page"],
.site-nav a[aria-current="true"] {
  animation: none;
  color: var(--text-bright);
  text-decoration: underline;
  text-underline-offset: 0.4em;
}

/* ── Site Footer ────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.footer-follow {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-bottom: 1rem;
}

.footer-follow a {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  border: none;
  color: var(--text-dim);
}

.footer-follow a:hover {
  color: var(--text-bright);
}

.site-footer p {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
  animation: text-thermal 8s ease-in-out infinite alternate;
  margin: 0;
}

/* ── Hero (homepage) ────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  text-align: center;
  padding: 2rem;
}

.hero-name {
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 200;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--text-primary);
}

.hero-role {
  font-size: clamp(0.75rem, 1.6vw, 0.8rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.4rem;
  animation: text-thermal 8s ease-in-out infinite alternate;
}

.hero-links {
  margin-top: 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-link {
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--mono);
  border-bottom: 1px solid;
  padding-bottom: 2px;
  animation:
    text-thermal   8s ease-in-out infinite alternate,
    border-thermal 8s ease-in-out infinite alternate;
}

.hero-link:hover, .hero-link:focus-visible {
  color: var(--text-bright) !important;
  border-color: var(--text-bright) !important;
}

/* ── Page Header ────────────────────────────────── */

.page-header {
  padding-bottom: 2rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
}

/* ── Post List ──────────────────────────────────── */

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2.5rem;
}

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

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.post-date, .post-reading-time {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2em 0.6em;
  color: var(--text-dim);
  transition: border-color var(--transition), color var(--transition);
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.post-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 200;
  margin-bottom: 0.6rem;
}

.post-title a {
  color: var(--text-primary);
  border: none;
}

.post-title a:hover {
  color: var(--text-bright);
  border: none;
}

.post-excerpt {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Tag list / Tag cloud ───────────────────────── */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-cloud .tag-pill {
  font-size: 0.8rem;
  padding: 0.3em 0.8em;
}

.tag-cloud-count {
  color: var(--text-dim);
  margin-left: 0.3em;
}

.tag-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.tag-list-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  transition: border-color var(--transition);
}

.tag-list-item:hover {
  border-color: var(--border-bright);
}

.tag-list-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  border: none;
  color: var(--text-primary);
}

.tag-list-link:hover {
  border: none;
  color: var(--text-bright);
}

.tag-list-name {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase; /* same display convention as .tag-pill (#737) */
}

/* The tag page heading: shown the way the pill shows the tag. Display only;
   the tag's name is unchanged in the data, the title and the feed label. */
.tag-title {
  text-transform: uppercase;
}

.tag-back {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.tag-list-count {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  font-family: var(--mono);
  color: var(--text-dim);
}

.tag-list-description {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Single Post ────────────────────────────────── */

.post-header {
  margin-bottom: 3rem;
}

.post-header h1 {
  margin-bottom: 1rem;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content h2 {
  margin: 2.5rem 0 1rem;
}

.post-content h3 {
  margin: 2rem 0 0.8rem;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content a {
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  animation: text-thermal 8s ease-in-out infinite alternate,
             border-thermal 8s ease-in-out infinite alternate;
}

.post-content a:hover {
  color: var(--text-bright);
  border-bottom-color: var(--text-bright);
}

/* HTML Embed wrapper emitted by the Decap "HTML Embed" editor component
   (admin/editor-component-html-embed.js). Vertical rhythm only — author
   markup inside the wrapper styles itself. */
.post-embed {
  display: block;
  margin: 1.5rem 0;
}

.featured-image {
  /* Block, not the inline default: an inline image sits on a text baseline, so
     its line box added a descender strip under the picture (#737). */
  display: block;
  width: 100%;
  /* The width/height attributes (#688) set the aspect ratio only; without
     this the height attribute would pin the box at the file's pixel height. */
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* In the post header the image's own 2rem stacked on `.post-header`'s 3rem and
   left about 90px before the body (#737). The header's margin is the one gap;
   the Decap preview pane renders the image outside a header and keeps 2rem. */
.post-header .featured-image {
  margin-bottom: 0;
}

/* ── Projects Grid ──────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: border-color var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.project-card:hover::before {
  opacity: 1;
}

.project-card-inner {
  position: relative;
  z-index: 1;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.project-card h3 a {
  color: var(--text-primary);
  border: none;
}

.project-tech {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--accent-text);
  margin-bottom: 0.8rem;
}

.project-description {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4em 0.9em;
  transition: border-color var(--transition), color var(--transition);
}

.project-link:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.2em 0.5em;
  z-index: 2;
}

/* The badge is a sibling of .project-card-inner, positioned out of flow, so
   the first line of the card would run under it on a narrow card (320px:
   "Claude Memory Map" under an ~85px badge). That first child is the h3 in
   tools/index.html but the .project-tech line in the projects markup, so pad
   whichever comes first. The badge's left edge sits ~101px (about 6.3rem) from
   the card edge and the card's own 1.8rem padding already covers about 29px of
   that, so 5.25rem leaves the text ~12px short of the badge and it wraps
   instead of running under it. overflow-wrap: break-word (not `anywhere`, which
   theme-overflow-wrap-css.test.js forbids) keeps one unbreakable word (a
   long URL-like title or technology) from overflowing the padding. */
.featured-badge ~ .project-card-inner > :first-child {
  padding-right: 5.25rem;
  overflow-wrap: break-word;
}

/* ── Page content ───────────────────────────────── */

.page-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.page-content h2 {
  margin: 2.5rem 0 1rem;
}

.page-content ul, .page-content ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

.page-content li {
  margin-bottom: 0.4rem;
}

.page-content a {
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  animation: text-thermal 8s ease-in-out infinite alternate,
             border-thermal 8s ease-in-out infinite alternate;
}

/* ── Page not found ─────────────────────────────── */

.page-not-found {
  text-align: center;
  padding-top: 2rem;
  border-bottom: none;
}

.page-not-found__code {
  font-family: var(--mono);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 200;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
  margin: 0;
  animation: text-thermal 8s ease-in-out infinite alternate;
}

.page-not-found__message {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin-top: 1rem;
}

.page-not-found__actions {
  text-align: center;
  margin-top: 2rem;
}

/* ── Utility ────────────────────────────────────── */

/* Skip link: off-screen until keyboard focus, then pinned top-left. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  transform: translateY(-120%);
  padding: 0.6rem 1rem;
  background: var(--bg-2);
  color: var(--text-bright);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.skip-link:focus {
  transform: translateY(0);
}

main:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ── Feed Link (RSS icon) ───────────────────────── */

.feed-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  vertical-align: middle;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: transparent;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.feed-link:hover,
.feed-link:focus-visible {
  color: #ee802f; /* canonical RSS orange — appears only on intent */
  border-color: #ee802f;
  background: rgb(238 128 47 / 8%);
}

.feed-link-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.page-header-with-feed {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
}

.page-header-with-feed h1,
.page-header-with-feed h2 {
  margin-bottom: 0;
}

/* ── Share Row ──────────────────────────────────── */

.share-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

.share-row-label {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
  margin-right: 0.4rem;
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.share-link svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.share-link:hover,
.share-link:focus-visible {
  color: var(--text-bright);
  border-color: var(--border-bright);
  background: var(--bg-2);
}

/* `.share-link svg` above is (0,1,1); a bare `.share-icon-success` (0,1,0)
   lost to it, so the idle copy button showed the link AND the check (#727).
   Keep this at least (0,2,0). */
.share-link .share-icon-success { display: none; }
.share-copy.share-copied .share-icon-default { display: none; }
.share-copy.share-copied .share-icon-success { display: block; }

.share-copy.share-copied {
  color: var(--text-bright);
  border-color: var(--accent);
}

/* The Mastodon instance field (#727): replaces a bare window.prompt(). It opens
   on its own line under the icons. A `display` here beats the UA's
   `[hidden] { display: none }`, so the hidden state is spelled out. */
.share-mastodon-form {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.share-mastodon-form[hidden],
.share-mastodon-error[hidden] {
  display: none;
}

.share-mastodon-form label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  color: var(--text-dim);
}

.share-mastodon-form input {
  flex: 1 1 11rem;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text-primary);
  font: inherit;
}

.share-mastodon-form input:focus-visible,
.share-mastodon-form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.share-mastodon-form button {
  min-height: 2.25rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.share-mastodon-form button:hover,
.share-mastodon-form button:focus-visible {
  color: var(--text-bright);
  border-color: var(--border-bright);
  background: var(--bg-2);
}

.share-mastodon-error {
  flex: 1 0 100%;
  margin: 0;
  color: var(--text-bright);
  font-size: 0.875rem;
}

/* Touch targets (#727): 1.9rem (~30px) is under the 44px minimum (WCAG 2.5.5,
   Apple HIG), so on a phone or any coarse pointer each button becomes a real
   2.75rem (44px) box. The icon stays 0.95rem, and the tighter gap and label
   margin keep all five buttons on one line down to a 360px viewport. Desktop
   (fine pointer, wider than a phone) is untouched. */
@media (pointer: coarse), (width <= 640px) {
  .share-row {
    gap: 0.25rem;
  }

  .share-row-label {
    margin-right: 0.25rem;
  }

  .share-link {
    width: 2.75rem;
    height: 2.75rem;
  }

  .share-mastodon-form input,
  .share-mastodon-form button {
    min-height: 2.75rem;
  }
}

@media (forced-colors: active) {
  .feed-link,
  .share-link,
  .share-mastodon-form button {
    border-color: ButtonText;
  }

  .feed-link:hover,
  .feed-link:focus-visible,
  .share-link:hover,
  .share-link:focus-visible {
    border-color: Highlight;
    color: Highlight;
  }
}

/* ── Reduced motion ─────────────────────────────── */

/* The glow, thermal color cycles and link shimmer all run forever. Honor the
   OS "reduce motion" setting by stopping every animation and parking the
   full-viewport glow at a static, subdued level. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
  }

  body::before {
    opacity: 0.3;
  }
}

/* ── Responsive ─────────────────────────────────── */

@media (width <= 640px) {
  .site-nav {
    gap: 1.2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 2.5rem 0;
  }
}
