/*
===============================================================================
YUNUS EMRE VURGUN — "DETAIL" LAYER
===============================================================================
Loaded last of the six core sheets (variables, ui-rebuild, ebook, jelly, blueprint, detail).
The jelly skin owns the palette, type, mascot and spring; the blueprint layer turned its
decoration into a drafting sheet. This layer adds the finish the blueprint pass left out, with
the same parts and nothing new in colour or type:

  · keys are machined: an engraved dish line inside the rim, a lit chamfer over a navy skirt,
    real travel when pressed; the red one keeps its jelly gloss on a deeper red skirt
  · toggles latch (a pressed navy key), counts and timestamps read as instrument labels
  · photos and thumbnails sit on a mat; avatars sit in a dial bezel with a red index
  · the end of an article is a set of plates (share keys, the book, further reading, the author)
    instead of loose text links

Every rule consumes tokens from variables.css (plus the two paper tints blueprint.css already
names); motion is transform/opacity only and stops under prefers-reduced-motion.
===============================================================================
*/

:root {
  --key-chamfer: var(--navy-500);
  --key-dish: rgba(38, 46, 77, 0.13);
  --key-face: linear-gradient(180deg, #fffefb 0%, #f2e9df 100%);
  --key-face-hover: linear-gradient(180deg, #ffffff 0%, #d9e9fd 100%);
  --jelly-skirt: color-mix(in srgb, var(--jelly-700) 64%, var(--navy-900));
  --label: 600 0.72rem/1.2 var(--font-mono);
}

/* ===== KEYS =========================================================================== */
/* The quiet key: cream face, engraved dish 3px inside the rim, a 1.5px lit chamfer, then the
   navy skirt it travels down into. */
.ui-btn-secondary,
.ui-masthead-links a:not(:first-child),
.ui-docs-page .ui-btn-secondary {
  background: var(--key-face);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.72),
    inset 0 0 0 3.5px var(--key-dish),
    inset 0 -3px 0 rgba(38, 46, 77, 0.07),
    0 1.5px 0 var(--key-chamfer),
    0 4px 0 var(--ink),
    0 11px 16px -9px rgba(27, 33, 64, 0.55);
}

.ui-btn-secondary:hover,
.ui-masthead-links a:not(:first-child):hover {
  background: var(--key-face-hover);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.8),
    inset 0 0 0 3.5px rgba(38, 46, 77, 0.16),
    inset 0 -3px 0 rgba(38, 46, 77, 0.07),
    0 1.5px 0 var(--key-chamfer),
    0 3px 0 var(--ink),
    0 8px 12px -8px rgba(27, 33, 64, 0.5);
}

.ui-btn-secondary:active,
.ui-masthead-links a:not(:first-child):active {
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.5),
    inset 0 0 0 3.5px rgba(38, 46, 77, 0.16),
    inset 0 2px 3px rgba(38, 46, 77, 0.16),
    0 0 0 var(--ink),
    0 2px 4px -2px rgba(27, 33, 64, 0.4);
}

/* The red key keeps its jelly: a gloss dome on top, a rim of light, and a deep red skirt. */
.ui-btn-primary,
.ui-masthead-links a:first-child {
  background:
    radial-gradient(120% 85% at 50% -12%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #e3302d 0%, var(--color-jelly) 42%, var(--jelly-600) 100%);
  border-color: var(--jelly-600);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.09),
    inset 0 -3px 0 rgba(110, 6, 6, 0.3),
    0 1.5px 0 var(--jelly-700),
    0 4px 0 var(--jelly-skirt),
    0 12px 18px -9px rgba(184, 15, 13, 0.6);
}

.ui-btn-primary:hover,
.ui-masthead-links a:first-child:hover {
  background:
    radial-gradient(120% 85% at 50% -12%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #d42320 0%, var(--jelly-600) 45%, var(--jelly-700) 100%);
  border-color: var(--jelly-700);
}

.ui-btn-primary:active,
.ui-masthead-links a:first-child:active {
  box-shadow:
    inset 0 2px 4px rgba(110, 6, 6, 0.35),
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.07),
    0 0 0 var(--jelly-skirt),
    0 3px 6px -3px rgba(184, 15, 13, 0.5);
}

.ui-btn-primary:active,
.ui-masthead-links a:first-child:active {
  transform: translateY(4px) scale(0.98, 1.02);
}

.ui-btn-secondary:active,
.ui-masthead-links a:not(:first-child):active {
  transform: translateY(4px);
}

.ui-btn:disabled,
.ui-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* A smaller key for toolbars and plates. */
.ui-btn-sm,
.ui-author-links .ui-btn,
.ui-project-links .ui-case-link {
  min-height: 40px;
  padding: 7px 18px 8px;
  font-size: 0.95rem;
}

/* ===== LATCHING KEYS: filter pills, pagination ========================================= */
/* Small cream keys with a short skirt; the selected one is latched down in navy. */
.ui-filter-pill,
a.ui-page-link {
  background: var(--key-face);
  border: 1.5px solid rgba(38, 46, 77, 0.3);
  box-shadow:
    inset 0 1.5px 0 #fff,
    0 2px 0 rgba(38, 46, 77, 0.3),
    0 7px 10px -8px rgba(27, 33, 64, 0.5);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow 160ms ease,
    transform 260ms var(--press);
}

.ui-filter-pill:hover,
a.ui-page-link:hover {
  background: var(--key-face-hover);
  border-color: var(--ink);
  box-shadow:
    inset 0 1.5px 0 #fff,
    0 2px 0 var(--ink),
    0 7px 10px -8px rgba(27, 33, 64, 0.5);
  transform: translateY(-1px);
}

.ui-filter-pill.is-active,
.ui-page-link.is-active {
  color: var(--color-text-inverse);
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-600) 100%);
  border-color: var(--navy-900);
  box-shadow:
    inset 0 2px 3px rgba(10, 14, 32, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 transparent;
  transform: translateY(2px);
}

.ui-page-link.is-disabled {
  border: 1.5px dashed rgba(38, 46, 77, 0.22);
}

/* ===== FIELDS ========================================================================= */
/* Machined fields: a squarer radius than the keys, a lighter rim, and a shadow cut into the top
   edge so the field reads as a recess rather than a raised pill. */
.ui-input,
input[type="text"].ui-input,
textarea.ui-input,
select.ui-input {
  border: 1.5px solid var(--color-control-border);
  border-radius: 12px;
  background: #fff;
  box-shadow:
    inset 0 2px 0 rgba(38, 46, 77, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.9);
}

.ui-input:hover {
  border-color: var(--navy-600);
}

.ui-input:focus {
  border-color: var(--ink);
  box-shadow:
    inset 0 2px 0 rgba(38, 46, 77, 0.06),
    0 0 0 4px rgba(105, 176, 249, 0.5);
}

.ui-input.is-invalid,
.ui-input.ui-input-error {
  border-color: var(--color-danger);
  box-shadow:
    inset 0 2px 0 rgba(184, 15, 13, 0.06),
    0 0 0 3px var(--color-danger-bg);
}

.ui-field-label {
  font-weight: 600;
  letter-spacing: 0.005em;
}

/* ===== REGISTRATION MARKS on the panels the blueprint pass missed ======================= */
.ui-glass-panel,
.ui-update-card,
.ebook-aside,
.ui-author-card {
  position: relative;
}

.ui-glass-panel::after,
.ui-update-card::after,
.ebook-aside::after,
.ui-author-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  pointer-events: none;
  opacity: 0.2;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 9px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 0 / 1.5px 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 9px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 1.5px 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 9px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 1.5px 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / 9px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / 1.5px 9px no-repeat;
  transition: opacity 200ms ease, inset 260ms var(--press);
}

.ui-update-card:hover::after,
.ui-author-card:hover::after,
.ebook-aside:hover::after {
  opacity: 0.6;
  inset: 6px;
}

/* ===== LABELS ========================================================================= */
/* Counts, dates and small classifications read as instrument labels: the label face, capitals,
   tracked out. */
.ui-project-meta,
.ui-updates-count,
.ui-feed-meta,
.ui-album-count,
.ui-reading-date,
.ui-reading-time,
.ui-share-label,
.ui-author-kicker,
.ebook-aside-spec dt {
  font: var(--label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ===== PORTFOLIO: one row per project ================================================= */
.ui-project-card {
  padding: var(--space-6);
  column-gap: var(--space-8);
}

/* The thumbnail sits on a mat with a hairline inner rule, like a print pinned to a board. */
.ui-project-shot {
  position: relative;
  padding: 8px;
  border-radius: 16px;
  background: var(--sky-50);
  box-shadow:
    inset 0 0 0 1px var(--rule),
    inset 0 1.5px 0 #fff;
}

.ui-project-shot .ui-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(38, 46, 77, 0.14),
    0 6px 14px -10px rgba(27, 33, 64, 0.6);
}

/* An image far from 4:3 is shown whole on a light table (a faint 12px grid) instead of cut. */
.ui-project-shot.is-fit {
  background:
    linear-gradient(rgba(38, 46, 77, 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, rgba(38, 46, 77, 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    var(--sky-50);
}

.ui-project-shot.is-fit .ui-media {
  object-fit: contain;
  object-position: 50% 50%;
  background: transparent;
  box-shadow: none;
}

.ui-project-body {
  gap: var(--space-3);
}

.ui-project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 2px 0 0;
  color: var(--color-text-tertiary);
}

.ui-project-meta > span + span::before {
  content: "/";
  margin: 0 0.7em;
  color: rgba(38, 46, 77, 0.35);
}

/* "Featured" is a real flag on the row, so it gets the red the site keeps for state. */
.ui-project-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-accent);
}

.ui-project-flag::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--color-jelly);
  order: -1;
}

.ui-project-title {
  font-size: clamp(1.3rem, 2.2vw, 1.55rem);
  margin: 0;
}

.ui-project-desc {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.65;
}

/* Technologies are part tags: a punched hole, a hairline edge, the label face. */
.ui-project-stack {
  gap: 8px;
  margin-top: 2px;
}

.ui-tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border: 1px solid rgba(38, 46, 77, 0.24);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.02em;
  box-shadow: 0 1px 0 rgba(38, 46, 77, 0.12);
}

.ui-tech-tag::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sky-100);
  box-shadow: inset 0 0 0 1.2px rgba(38, 46, 77, 0.45);
}

.ui-project-links {
  margin-top: var(--space-2);
}

/* The project link is a small key, the same part as every other action on the site. */
.ui-project-links .ui-case-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-full);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  background: var(--key-face);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.72),
    inset 0 0 0 3.5px var(--key-dish),
    0 1.5px 0 var(--key-chamfer),
    0 3px 0 var(--ink),
    0 9px 12px -8px rgba(27, 33, 64, 0.5);
  transition: transform 220ms var(--press), box-shadow 160ms ease, background-color 160ms ease;
}

.ui-project-links .ui-case-link:hover {
  color: var(--ink);
  background: var(--key-face-hover);
  text-decoration: none;
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.8),
    inset 0 0 0 3.5px rgba(38, 46, 77, 0.16),
    0 1.5px 0 var(--key-chamfer),
    0 2px 0 var(--ink),
    0 7px 10px -8px rgba(27, 33, 64, 0.5);
}

.ui-project-links .ui-case-link:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 3px rgba(38, 46, 77, 0.16), 0 0 0 var(--ink);
}

@media (max-width: 700px) {
  .ui-project-card {
    row-gap: var(--space-5);
    padding: var(--space-5);
  }
}

/* ===== GALLERY ======================================================================== */
.ui-album-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

.ui-album-title {
  margin: 0;
}

.ui-album-count {
  padding: 4px 8px;
  border: 1px solid rgba(38, 46, 77, 0.24);
  border-radius: 6px;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.55);
}

.ui-album-description {
  flex-basis: 100%;
  color: var(--color-text-secondary);
}

/* The photo sits in a cream mat; the border is outside the clipping box, so the neighbouring
   slides never show through it. */
.ui-slideshow-viewport {
  border: 8px solid var(--color-bg-card);
  border-radius: 22px;
  background: var(--navy-900);
  box-shadow:
    0 0 0 1px rgba(38, 46, 77, 0.1),
    var(--shadow-md);
}

.ui-slideshow-arrow {
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--key-face);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.72),
    inset 0 0 0 3.5px var(--key-dish),
    0 1.5px 0 var(--key-chamfer),
    0 3px 0 var(--ink),
    0 9px 12px -8px rgba(27, 33, 64, 0.5);
  transition: transform 220ms var(--press), box-shadow 160ms ease, background-color 160ms ease;
}

.ui-slideshow-arrow:hover,
.ui-slideshow-arrow:focus-visible {
  color: var(--ink);
  background: var(--key-face-hover);
}

.ui-slideshow-arrow:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 3px rgba(38, 46, 77, 0.18), 0 0 0 var(--ink);
}

.ui-slideshow-arrow svg {
  width: 22px;
  height: 22px;
}

/* The caption runs under the photo, not across the arrows: counter plate, then the title. */
.ui-slideshow-meta {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin: 16px calc(48px + var(--space-3)) 0;
  padding: 0;
}

.ui-slideshow-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 5px;
  border-radius: 7px;
  background: var(--ink);
  color: #e9f1ff;
  font: var(--label);
  letter-spacing: 0.12em;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 0 rgba(20, 26, 51, 0.38);
}

.ui-slideshow-of {
  color: var(--sky-300);
}

.ui-slideshow-caption {
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ui-slideshow-caption:empty {
  display: none;
}

@media (max-width: 600px) {
  .ui-slideshow-meta {
    margin-inline: calc(40px + var(--space-2));
  }

  .ui-slideshow-viewport {
    border-width: 5px;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .ui-slideshow-meta {
    flex-direction: row;
    align-items: center;
    margin-inline: calc(36px + var(--space-2));
  }
}

/* ===== ARTICLE END: share keys ======================================================== */
/* The rule above the bar is a scale: a hairline with a tick every 10px and a longer one every 50. */
.ui-share-bar,
.ui-doc-links {
  position: relative;
  border-top: 0;
}

.ui-share-bar::before,
.ui-doc-links::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  pointer-events: none;
  background:
    linear-gradient(var(--rule-strong), var(--rule-strong)) 0 0 / 100% 1px no-repeat,
    linear-gradient(90deg, var(--rule-strong) 1px, transparent 1px) 0 0 / 50px 9px repeat-x,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 10px 5px repeat-x;
}

.ui-share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: calc(var(--space-5) + 4px);
}

.ui-share-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(38, 46, 77, 0.3);
  transition: text-decoration-color 160ms ease, color 160ms ease;
}

.ui-share-back:hover {
  color: var(--color-accent);
  text-decoration-color: currentColor;
}

.ui-share-back > span {
  display: inline-block;
  transition: transform 240ms var(--press);
}

.ui-share-back:hover > span {
  transform: translateX(-3px);
}

.ui-share-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ui-share-label {
  margin-right: 4px;
  color: var(--color-text-tertiary);
}

.ui-share-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 1px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--key-face);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.72),
    inset 0 0 0 3.5px var(--key-dish),
    0 1.5px 0 var(--key-chamfer),
    0 3px 0 var(--ink),
    0 9px 12px -8px rgba(27, 33, 64, 0.5);
  transition: transform 220ms var(--press), box-shadow 160ms ease, background-color 160ms ease;
}

.ui-share-key:hover {
  color: var(--ink);
  background: var(--key-face-hover);
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.8),
    inset 0 0 0 3.5px rgba(38, 46, 77, 0.16),
    0 1.5px 0 var(--key-chamfer),
    0 2px 0 var(--ink),
    0 7px 10px -8px rgba(27, 33, 64, 0.5);
}

.ui-share-key:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 3px rgba(38, 46, 77, 0.18), 0 0 0 var(--ink);
}

.ui-share-key.is-done {
  background: linear-gradient(180deg, #ffffff 0%, var(--color-success-bg) 100%);
}

.ui-share-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

/* ===== ARTICLE END: the book ========================================================== */
.ebook-aside {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
  max-width: none;
  padding: var(--space-8);
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-md);
}

/* The cover leans like the photographs on the home page and straightens when the card is hovered. */
.ebook-aside-cover {
  display: block;
  margin-top: 4px;
  border-radius: 4px 8px 8px 4px;
  transform: rotate(-2.5deg);
  transform-origin: 50% 100%;
  box-shadow:
    inset 0 0 0 1px rgba(38, 46, 77, 0.12),
    0 2px 0 rgba(38, 46, 77, 0.1),
    0 16px 22px -12px rgba(27, 33, 64, 0.55);
  transition: transform 420ms var(--ease-jelly);
}

.ebook-aside-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.ebook-aside:hover .ebook-aside-cover {
  transform: rotate(0) translateY(-2px);
}

.ebook-aside-body {
  min-width: 0;
}

.ebook-aside .ui-eyebrow {
  margin-bottom: var(--space-2);
}

.ebook-aside-title {
  max-width: 28ch;
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.ebook-aside-text {
  max-width: 64ch;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
}

.ebook-aside-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-8);
  margin-top: var(--space-6);
}

.ebook-aside .ebook-aside-cta {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-base);
  text-decoration: none;
}

.ebook-aside-spec {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.ebook-aside-spec > div {
  display: grid;
  gap: 3px;
  padding: 0 18px;
  border-left: 1px dashed rgba(38, 46, 77, 0.28);
}

.ebook-aside-spec > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.ebook-aside-spec dt {
  color: var(--color-accent);
}

.ebook-aside-spec dd {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .ebook-aside {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: var(--space-5);
    padding: var(--space-6) var(--space-5);
  }

  .ebook-aside-foot {
    margin-left: calc(-84px - var(--space-5));
  }
}

/* ===== ARTICLE END: further reading =================================================== */
.ui-reading-list--cards {
  gap: var(--space-3);
  border-bottom: 0;
}

.ui-reading-list--cards a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: var(--space-6);
  position: relative;
  padding: 18px 18px 18px 24px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(38, 46, 77, 0.05);
}

.ui-reading-list--cards a:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(38, 46, 77, 0.08);
}

/* A small round key at the end of each row; the arrow slides when the row is hovered. */
.ui-reading-list--cards a::after {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--key-face);
  box-shadow:
    inset 0 0 0 1.5px var(--ink),
    inset 0 0 0 3.5px rgba(255, 255, 255, 0.7),
    inset 0 0 0 4.5px var(--key-dish),
    0 2px 0 var(--ink);
}

.ui-reading-list--cards a::before {
  content: "";
  position: absolute;
  right: 29px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: var(--ink);
  -webkit-mask: url("../images/blueprint/arrow.svg") center / contain no-repeat;
  mask: url("../images/blueprint/arrow.svg") center / contain no-repeat;
  transition: transform 240ms var(--press);
  z-index: 1;
}

.ui-reading-list--cards a:hover::before {
  transform: translateX(3px);
}

.ui-reading-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ui-reading-list--cards .ui-reading-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.ui-reading-list--cards .ui-reading-excerpt {
  margin: 0;
  max-width: 70ch;
  overflow: hidden;
  color: var(--color-text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ui-reading-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
  white-space: nowrap;
}

.ui-reading-list--cards .ui-reading-date {
  color: var(--color-text-secondary);
}

.ui-reading-time {
  color: var(--color-text-tertiary);
}

@media (max-width: 640px) {
  .ui-reading-list--cards a {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: var(--space-2) var(--space-4);
    padding: 16px;
  }

  .ui-reading-list--cards .ui-reading-side {
    grid-row: 2;
    flex-direction: row;
    gap: 12px;
  }

  .ui-reading-list--cards a::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .ui-reading-list--cards a::before {
    right: 27px;
  }

  .ui-reading-list--cards .ui-reading-excerpt {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ===== ARTICLE END: the author ======================================================== */
.ui-author-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-md);
}

.ui-author-kicker {
  margin: 0 0 6px;
  color: var(--color-accent);
}

.ui-author-name {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.ui-author-role {
  max-width: 62ch;
  margin: var(--space-2) 0 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.ui-author-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

@media (max-width: 640px) {
  .ui-author-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5);
  }
}

/* ===== AVATAR BEZEL =================================================================== */
/* The portrait sits in a dial bezel: a cream ring with a long tick every 45 degrees and a short one
   every 15, a navy rim, and the red index the homepage dial uses. Hovering turns the inner scale. */
.ui-avatar-bezel {
  --bz: 60px;
  position: relative;
  flex: none;
  display: inline-block;
  width: var(--bz);
  height: var(--bz);
  padding: calc(var(--bz) * 0.12);
  border-radius: 50%;
  /* major ticks every 45 degrees on the outer 10%, the cream face covering their inner ends */
  background:
    radial-gradient(closest-side, var(--cream-50) calc(100% - var(--bz) * 0.1), transparent calc(100% - var(--bz) * 0.1 + 0.5px)),
    repeating-conic-gradient(from -1deg, var(--ink) 0 2deg, transparent 2deg 45deg),
    radial-gradient(circle at 34% 26%, #ffffff 0%, var(--cream-100) 72%);
  box-shadow:
    0 0 0 1.5px var(--ink),
    0 3px 0 1.5px rgba(20, 26, 51, 0.25),
    0 12px 18px -10px rgba(27, 33, 64, 0.55);
}

.ui-avatar-bezel::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: repeating-conic-gradient(from -0.6deg, rgba(38, 46, 77, 0.6) 0 1.2deg, transparent 1.2deg 15deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--bz) * 0.075), #000 calc(100% - var(--bz) * 0.075 + 0.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--bz) * 0.075), #000 calc(100% - var(--bz) * 0.075 + 0.5px));
  transition: transform 900ms var(--ease-jelly);
  pointer-events: none;
}

.ui-avatar-bezel::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 8px solid var(--color-jelly);
  border-bottom: 0;
  filter: drop-shadow(0 1px 0 rgba(20, 26, 51, 0.35));
  pointer-events: none;
}

.ui-avatar-bezel:hover::before {
  transform: rotate(90deg);
}

.ui-avatar-bezel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: var(--color-sky-soft);
  box-shadow:
    0 0 0 1.5px var(--ink),
    0 0 0 3px rgba(255, 255, 255, 0.85);
}

.ui-avatar-bezel--lg {
  --bz: 92px;
}

/* Update detail header: the bezel beside the title on the sheet. */
.ui-update-head {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.ui-update-head .ui-update-body > * {
  margin: 0;
}

.ui-update-head .ui-section-title {
  margin: var(--space-3) 0 var(--space-1);
}

@media (max-width: 520px) {
  .ui-update-head {
    align-items: flex-start;
    gap: var(--space-4);
  }

  .ui-update-head .ui-avatar-bezel--lg {
    --bz: 64px;
  }
}

/* The list view's avatars get the rim and the cream gap of the bezel (an <img> has no pseudo
   elements for the ticks). */
.ui-updates-grid .ui-update-avatar {
  border-radius: 50%;
  border: 3px solid var(--color-bg-card);
  box-shadow: 0 0 0 1.5px var(--ink), 0 4px 8px -4px rgba(27, 33, 64, 0.45);
}

/* ===== CONTACT ======================================================================== */
.ui-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-2);
}

/* The arithmetic check is a small instrument: a readout, a reset key and the answer field. */
.ui-captcha-section {
  margin: 0;
  padding: var(--space-4) var(--space-5) var(--space-5);
  border: 1px dashed rgba(38, 46, 77, 0.3);
  border-radius: var(--radius-lg);
  background: var(--sky-50);
  min-width: 0;
}

.ui-captcha-section > legend {
  float: left;
  width: 100%;
  margin-bottom: var(--space-3);
  padding: 0;
}

.ui-captcha-container {
  clear: both;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.ui-captcha-question {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-700) 100%);
  color: #e9f1ff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  word-spacing: -0.2em;
  white-space: nowrap;
  box-shadow:
    inset 0 2px 4px rgba(10, 14, 32, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9);
}

.ui-captcha-refresh {
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--key-face);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.72),
    inset 0 0 0 3.5px var(--key-dish),
    0 1.5px 0 var(--key-chamfer),
    0 3px 0 var(--ink);
  transition: transform 220ms var(--press), box-shadow 160ms ease, background-color 160ms ease;
}

.ui-captcha-refresh:hover {
  color: var(--ink);
  background: var(--key-face-hover);
}

.ui-captcha-refresh:hover svg {
  transform: rotate(90deg);
}

.ui-captcha-refresh svg {
  transition: transform 420ms var(--ease-jelly);
}

.ui-captcha-refresh:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 3px rgba(38, 46, 77, 0.18), 0 0 0 var(--ink);
}

.ui-captcha-answer {
  flex: 0 1 140px;
  width: 140px;
  min-height: 44px;
  margin: 0;
}

.ui-captcha-hint {
  margin: var(--space-3) 0 0;
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
}

/* The message counter is a readout under the field's right edge. */
.char-count {
  margin-top: 6px;
  color: var(--color-text-tertiary);
  font: var(--label);
  letter-spacing: 0.08em;
  text-align: right;
}

.char-count.warning {
  color: var(--color-warning);
}

.char-count.error {
  color: var(--color-danger);
}

/* Sent / failed notices, server-rendered (.ui-notice) or added by contact.js (.alert). */
.ui-notice,
.ui-contact-grid .alert {
  margin-bottom: var(--space-5);
  padding: 14px 18px 14px 16px;
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  background: var(--color-info-bg);
  color: var(--color-text-primary);
  box-shadow: inset 4px 0 0 var(--color-info);
}

.ui-notice p {
  margin: 0;
}

.ui-notice.is-success,
.ui-contact-grid .alert-success {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  box-shadow: inset 4px 0 0 var(--color-success);
}

.ui-notice.is-error,
.ui-contact-grid .alert-danger {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.ui-contact-aside .ui-card-list li strong {
  font-family: var(--font-display);
  font-weight: 600;
}

/* ===== MOTION POLICY ================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ui-filter-pill:hover,
  a.ui-page-link:hover,
  .ui-share-key:hover,
  .ui-share-key:active,
  .ui-project-links .ui-case-link:hover,
  .ui-project-links .ui-case-link:active,
  .ui-slideshow-arrow:active,
  .ui-captcha-refresh:active,
  .ui-captcha-refresh:hover svg,
  .ui-avatar-bezel:hover::before,
  .ebook-aside:hover .ebook-aside-cover,
  .ui-share-back:hover > span,
  .ui-reading-list--cards a:hover::before {
    transform: none !important;
  }

  .ui-btn-primary:active,
  .ui-btn-secondary:active {
    transform: none !important;
  }
}

/* Windows high contrast drops backgrounds and shadows: keys and plates keep a border. */
@media (forced-colors: active) {
  .ui-share-key,
  .ui-slideshow-counter,
  .ui-captcha-question,
  .ui-avatar-bezel,
  .ui-tech-tag,
  .ui-importance,
  .ui-view-toggle a.is-active {
    border: 1px solid CanvasText;
  }

  .ui-avatar-bezel::before,
  .ui-reading-list--cards a::after {
    display: none;
  }
}

@media print {
  .ui-glass-panel::after,
  .ui-update-card::after,
  .ebook-aside::after,
  .ui-author-card::after,
  .ui-share-bar {
    display: none;
  }
}
