/* ------------------------------------------------------------------
   Portfolio — public stylesheet

   A dark, instrument-panel reading of a developer portfolio: ink-navy
   ground, numbered bands down one page, and monospace reserved for the
   things that are genuinely data — section numbers, tags, meters, the
   identity rows. Amber is the only accent and it marks what is live or
   interactive; nothing is coloured for decoration.
   ------------------------------------------------------------------ */

:root {
  color-scheme: dark;
  --bg: #0b1118;
  --bg-lift: #111a24;
  --bg-panel: #16212d;
  --text: #d9e2ea;
  --text-2: #90a3b4;
  --text-3: #627687;
  --line: #1d2a37;
  --line-2: #2c3d4e;
  --accent: #e8a33d;
  --accent-dim: #8a6324;
  --live: #68cdb9;
  --bad: #e5806b;

  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas,
    monospace;

  --gutter: clamp(1.1rem, 4vw, 3rem);
  --shell: 70rem;
  --measure: 40rem;
  --radius: 4px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #f3bd6c;
}

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

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

.shell {
  width: min(var(--shell), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 20;
  background: var(--bg-panel);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}

/* --- masthead ---------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 17, 24, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wordmark b {
  color: var(--accent);
  font-weight: 600;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1.4rem);
  font-size: 0.875rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0.6rem;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
}

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

.hero {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(2.5rem, 6vw, 4rem);
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
}

@media (max-width: 56rem) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--live);
  border: 1px solid color-mix(in srgb, var(--live) 35%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.7rem 0.2rem 0.55rem;
  margin-bottom: 1.5rem;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 18%, transparent);
}

.hero-name {
  font-size: clamp(2.5rem, 8vw, 4.75rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin-bottom: 0.75rem;
}

.hero-role {
  font-family: var(--mono);
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}

.hero-tagline {
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 32rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* --- identity panel ---------------------------------------------- */

.panel {
  background: var(--bg-lift);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}

.dots {
  display: flex;
  gap: 0.3rem;
  margin-right: 0.3rem;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
}

.id-rows {
  margin: 0;
  padding: 0.9rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
}

.id-rows dt {
  color: var(--text-3);
  white-space: nowrap;
}

.id-rows dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  border-top: 1px solid var(--line);
}

.counter {
  padding: 0.8rem 0.9rem;
  border-right: 1px solid var(--line);
}

.counter:last-child {
  border-right: 0;
}

.counter b {
  display: block;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.counter span {
  font-size: 0.75rem;
  color: var(--text-3);
}

.portrait {
  border-bottom: 1px solid var(--line);
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* --- buttons ----------------------------------------------------- */

.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #15100a;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: #f3bd6c;
  border-color: #f3bd6c;
  color: #15100a;
}

.btn-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}

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

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.3rem 0.7rem;
}

/* --- bands ------------------------------------------------------- */

.band {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.band-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}

.band-num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent-dim);
  flex: none;
}

.band-head h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.9rem);
}

.band-intro {
  color: var(--text-2);
  margin: -1rem 0 1.75rem;
}

/* --- skills ------------------------------------------------------ */

.skill-groups {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.skill-group {
  background: var(--bg-lift);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

.skill {
  margin-bottom: 0.7rem;
}

.skill:last-child {
  margin-bottom: 0;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.skill-label span:last-child {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}

.meter {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.skill-plain {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0;
}

/* --- projects ---------------------------------------------------- */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}

.card {
  background: var(--bg-lift);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.card-body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.4rem;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
}

.card p {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 0.85rem;
}

.card-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.9rem;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 0.08rem 0.4rem;
}

.bullets {
  margin: 0 0 0.9rem;
  padding-left: 1.05rem;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.bullets li {
  margin-bottom: 0.3rem;
}

/* --- timeline ---------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 1px solid var(--line);
}

.timeline > li {
  position: relative;
  padding-bottom: 1.75rem;
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 4px);
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
}

.item-title {
  font-size: 1.0625rem;
  margin-bottom: 0.15rem;
}

.item-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.55rem;
}

.item-meta b {
  color: var(--text-2);
  font-weight: 400;
}

.timeline p {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

/* --- certifications ---------------------------------------------- */

.rows-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rows-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.rows-list .what {
  font-size: 1rem;
}

.rows-list .who {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}

/* --- contact ----------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}

@media (max-width: 52rem) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.channels {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.channels li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.channels span {
  color: var(--text-3);
}

.field {
  margin-bottom: 0.9rem;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-bottom: 0.3rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-lift);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.notice {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--text-3);
  border-radius: var(--radius);
  background: var(--bg-lift);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.notice-good {
  border-left-color: var(--live);
}

.notice-bad {
  border-left-color: var(--bad);
  color: var(--bad);
}

/* --- inner pages ------------------------------------------------- */

.page-head {
  padding-block: clamp(2.5rem, 7vw, 4rem) clamp(1.25rem, 3vw, 2rem);
}

.page-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.9rem;
}

.lede {
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 38rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.filters a {
  color: var(--text-2);
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
}

.filters a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filters a[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #15100a;
}

.case-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 13rem minmax(0, 1fr);
  align-items: start;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

@media (max-width: 54rem) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}

.case-section {
  margin-bottom: 2rem;
}

.case-section h2 {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 0.7rem;
  letter-spacing: 0.02em;
}

.case-cover {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.75rem;
  width: 100%;
}

.gallery {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.gallery figure {
  margin: 0;
}

.gallery img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
}

.gallery figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.4rem;
}

.next-link {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  margin-top: 2rem;
  text-decoration: none;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.next-link strong {
  display: block;
  font-family: var(--sans);
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-top: 0.25rem;
}

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

.empty {
  color: var(--text-3);
  font-style: italic;
}

/* --- footer ------------------------------------------------------ */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 2rem 2.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  align-items: baseline;
}

.foot a {
  color: var(--text-2);
  text-decoration: none;
}

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

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

/* --- entry rows -------------------------------------------------- */

.entry-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* Set by the template when the image slot will draw nothing, so the text
   takes the full width instead of sitting beside an empty column. */
.entry-row.is-text-only {
  grid-template-columns: minmax(0, 1fr);
}

/* The stand-in for a missing image: a plain tile carrying the item's
   placeholder text. Deliberately flat — it is a gap being acknowledged,
   not a thing competing with the real images beside it. */
.media-placeholder {
  display: grid;
  place-items: center;
  padding: 0.75rem;
  text-align: center;
  background: var(--bg-panel);
  border: 1px dashed var(--line-2);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.35;
  overflow: hidden;
}

.media-placeholder span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-lift);
}

.entry-thumb-link {
  display: block;
}

.item-title a {
  color: var(--text);
  text-decoration: none;
}

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

.crumb {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.crumb a {
  color: var(--text-3);
  text-decoration: none;
}

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

@media (max-width: 40rem) {
  .entry-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry-thumb {
    max-width: 10rem;
  }
}

/* --- cursor themes ----------------------------------------------- */
/*
   CSS-only themes just set `cursor`. The scripted ones draw their own
   elements, and the native pointer is hidden only once cursor.js has
   confirmed a fine pointer and added `has-custom-cursor` — so if the
   script never runs, the normal cursor stays exactly where it was.
*/

:root[data-cursor="precision"],
:root[data-cursor="precision"] body {
  cursor: crosshair;
}

:root[data-cursor="pointer-heavy"] body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M6 3l20 13-8.5 1.8L22 29l-4 1.6-4.4-11.3L6 24z' fill='%23e8a33d' stroke='%230b1118' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E")
      4 2,
    auto;
}

:root.has-custom-cursor,
:root.has-custom-cursor body,
:root.has-custom-cursor a,
:root.has-custom-cursor button,
:root.has-custom-cursor input,
:root.has-custom-cursor textarea,
:root.has-custom-cursor select,
:root.has-custom-cursor summary {
  cursor: none;
}

.cursor-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}

.cursor-layer.is-visible {
  opacity: 1;
}

.cursor-layer > * {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

/* Each piece is centred on the pointer by offsetting half its own size. */
.cursor-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--accent);
}

.cursor-ring {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease,
    border-color 0.18s ease, opacity 0.18s ease;
}

.cursor-layer.is-over .cursor-ring {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-color: var(--accent);
}

.cursor-layer.is-down .cursor-ring {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
}

.cursor-bead {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Soft glow: the ring becomes a blurred halo rather than an outline. */
:root[data-cursor="glow"] .cursor-ring {
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 26%, transparent) 0%,
    transparent 68%
  );
}

:root[data-cursor="glow"] .cursor-layer.is-over .cursor-ring {
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
}

/* Developer: a thin crosshair spanning the viewport, plus a readout. */
:root[data-cursor="developer"] .cursor-dot {
  width: 1px;
  height: 100vh;
  margin: 0;
  top: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  transform-origin: top left;
}

:root[data-cursor="developer"] .cursor-ring {
  width: 100vw;
  height: 1px;
  margin: 0;
  left: 0;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: none;
}

.cursor-readout {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--bg);
  background: var(--accent);
  border-radius: 2px;
  padding: 0.05rem 0.3rem;
  margin: 10px 0 0 10px;
  white-space: nowrap;
}

/* Hacker terminal: a blinking block caret. */
:root[data-cursor="terminal"] .cursor-dot {
  width: 9px;
  height: 18px;
  margin: -2px 0 0 -1px;
  border-radius: 1px;
  background: var(--live);
  box-shadow: 0 0 10px color-mix(in srgb, var(--live) 60%, transparent);
  animation: caret-blink 1.05s steps(1, end) infinite;
}

:root[data-cursor="terminal"] .cursor-layer.is-over .cursor-dot {
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 65%, transparent);
}

@keyframes caret-blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0.15;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }

  /* The caret stops flashing rather than disappearing mid-blink. */
  :root[data-cursor="terminal"] .cursor-dot {
    opacity: 1;
  }
}

/* Nothing custom on touch: there is no pointer to replace. */
@media (pointer: coarse) {
  .cursor-layer {
    display: none;
  }

  :root.has-custom-cursor,
  :root.has-custom-cursor body,
  :root.has-custom-cursor a,
  :root.has-custom-cursor button,
  :root.has-custom-cursor input,
  :root.has-custom-cursor textarea,
  :root.has-custom-cursor select,
  :root.has-custom-cursor summary {
    cursor: auto;
  }
}
