/* GENERATED from ../profile.css by scripts/build-deploy.mjs — do NOT edit here.
   Edit the root copy, then run: npm run build:deploy */
/* Days warm-paper tokens (kept in sync with entries.css so the page is self-contained). */
:root {
  --paper: #faeeda;
  --ink: #412402;
  --ink-soft: #633806;
  --accent: #ba7517;
  --accent-deep: #854f0b;
  --rule: #e0c79b;
  --page-bg: #f4ede0;
  --page-fg: #4a3a22;
  /* Save cards (showcase media pane): the stage is width-driven, but these still bound
     how large a single card may grow. */
  --card-max-w: min(80vw, 700px);
  --note-w: min(330px, 80vw);     /* text-only paper notes and tweet quotes */
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #1a1712;
    --page-fg: #d8c6a6;
    --rule: #c9a36b;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-fg);
  font: 15px/1.6 Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  /* Never let the page itself scroll sideways — horizontal scrolling belongs to the strip. */
  overflow-x: hidden;
}

/* Full-height column: links centered on the first screen, name at its bottom, saves below. */
.profile { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
/* The first screen overlays its two layers on one grid cell: the link columns center against
   the FULL viewport (not just the space left over above the nameplate), while the hint +
   nameplate anchor to the bottom edge. */
.view { min-height: 100vh; display: grid; min-width: 0; }
.view > * { grid-area: 1 / 1; }
.link-block { align-self: center; }
.view-foot { align-self: end; width: 100%; }
/* On short windows the layers could collide — fall back to stacking, where the columns
   center in the space above the nameplate instead of overlapping it. */
@media (max-height: 640px) {
  .view { display: flex; flex-direction: column; }
  .link-block { flex: 1; }
}

/* --- Save cards: compact paper cards, rendered one at a time on the showcase stage --- */
.strip-card, .strip-img { -webkit-user-drag: none; user-select: none; }

.strip-card {
  flex: 0 0 auto;
  max-width: var(--card-max-w);
  display: flex;
  flex-direction: column;
  /* Resets so a <button> card (media → lightbox) matches an <a> card (text → source). */
  margin: 0;
  padding: 0;
  border: 0;
  text-align: left;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.18s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.18s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.strip-card:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); transform: translateY(-2px); }
.strip-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Text-only saves and tweet quotes read as fixed-width paper notes. */
.strip-card--text { width: var(--note-w); min-height: 220px; }

.strip-media { position: relative; background: var(--paper); line-height: 0; }
.strip-img {
  /* Natural aspect ratio, bounded by the stage: never wider than the pane, never taller
     than the showcase's media budget. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
  display: block;
}
.strip-media--empty {
  display: flex; align-items: center; justify-content: center;
  width: var(--note-w); height: 200px;
  color: var(--accent); font: 34px/1 system-ui, sans-serif;
}
.strip-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.strip-cap { padding: 18px; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.strip-snippet {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 12;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Tweets as native Days cards (no X widget: the strip keeps its height rhythm) --- */
/* Photo tweet: the image fills the card; author + X glyph sit on a gradient bar at the foot. */
.strip-card--xphoto { position: relative; }
.strip-xbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  color: #fff;
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  pointer-events: none;
}
.strip-xauthor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-xglyph { flex: none; width: 14px; height: 14px; }
.strip-xbar .strip-xglyph, .strip-xfoot .strip-xglyph { margin-left: auto; }
/* Text tweet: a paper pull-quote in the site's serif, author line at the bottom. */
.strip-card--xquote { padding: 22px 20px 18px; }
.strip-xquote {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  font: 400 17px/1.5 Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.strip-xfoot {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-soft);
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* Legacy tweet with no captured text or photo: just the glyph and a "view" hint. */
.strip-card--xmin { align-items: center; justify-content: center; gap: 10px; color: var(--ink-soft); }
.strip-xglyph--big { width: 28px; height: 28px; }
.strip-xview { font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; }

/* --- Saves showcase: the pinned stage a page scroll walks through (YC style) --- */
.show { position: relative; }
.show-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.show-grid {
  height: 100%;
  display: grid;
  /* Dates sit left of center; the media takes the rest of the stage on the right. */
  grid-template-columns: minmax(200px, 28vw) 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 48px 0 6vw;
}
.show-pane { min-width: 0; display: flex; justify-content: center; }

/* The center stack of titles. The track translates with scroll; per-title opacity falls off
   with distance from center (set in JS). A mask softens the stack's top/bottom edges. */
.show-titles {
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.show-titles-track { will-change: transform; }
.show-title {
  /* Row height doubles as the spacing between titles — the scroll math reads offsetHeight,
     so breathing room lives here rather than in margins (which it wouldn't see). */
  height: clamp(120px, 20vh, 180px);
  margin: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Young Serif", Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 52px);
  line-height: 1.04;
  color: var(--page-fg);
  cursor: pointer;
  overflow: hidden;
}
.show-title span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Side panes fade up when the active save changes (nodes are recreated each swap). */
.show-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  animation: showfade 0.35s ease;
}
@keyframes showfade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.show-side-label { font-style: italic; font-size: 17px; color: var(--page-fg); }
.show-media { max-width: 100%; display: flex; justify-content: center; }
/* The card must never outgrow its pane: allow it to shrink (the strip's flex-shrink:0 is
   wrong here) and cap it at the pane's width so wide images scale down, not overflow. */
.show-media .strip-card { max-height: 70vh; max-width: 100%; flex-shrink: 1; min-width: 0; }
.show-media .strip-media { max-width: 100%; }
.show-cap {
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--page-fg);
  opacity: 0.72;
  text-decoration: none;
  text-align: center;
}
a.show-cap:hover { opacity: 1; text-decoration: underline; }

/* The invitation to scroll (or the empty-state hint), sitting above the nameplate.
   Young Serif upright (it has no true italic — a faux slant would look worse), in the
   page ink at low opacity so it whispers instead of going orange. */
.show-hint {
  margin: 0 0 30px;
  text-align: center;
  font-family: "Young Serif", Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-style: normal;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--page-fg);
  opacity: 0.5;
}

@media (max-width: 900px) {
  .show-grid { grid-template-columns: 1fr; gap: 12px; padding: 16px 20px; align-content: start; }
  .show-titles { height: 22vh; }
  .show-title { height: clamp(72px, 12vh, 96px); font-size: clamp(22px, 6vw, 32px); }
  .show-media .strip-card { max-height: 46vh; }
  .strip-img { max-height: 42vh; }
}

/* Full-size media popup (clicking a media card). Mirrors entries.css so openLightbox works here. */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.82);
  animation: fade 0.18s ease;
}
.lightbox-media {
  max-width: 100%; max-height: calc(100vh - 64px);
  display: block; border-radius: 6px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}
.lightbox-close {
  position: fixed; top: 16px; right: 20px; width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --- Link block: three switchable layouts (profile.linkLayout, picked via the cog) ---
   All three share the same DOM and the same quiet small-cap headings; only arrangement
   changes. Hairlines use a softened --rule so they read as engraving, not borders. */
.link-block { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.link-cols { display: flex; flex-direction: column; align-items: center; }
.link-col { min-width: 0; }
.link-heading {
  margin: 0 0 10px;
  /* Young Serif ships one weight (400) — the caps + tracking carry the hierarchy. */
  font: 400 12px/1.2 "Young Serif", Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--page-fg);
  opacity: 0.55;
}

/* 1 · Columns: side by side, hairline dividers. Columns stretch to the tallest one
   (content still starts at the top) so both dividers run the same full height. */
.link-block--columns .link-cols { flex-direction: row; align-items: stretch; justify-content: center; text-align: center; }
.link-block--columns .link-col { padding: 0 44px; min-width: 150px; }
.link-block--columns .link-col + .link-col { border-left: 1px solid color-mix(in srgb, var(--rule) 65%, transparent); }

/* 2 · Index: ledger rows — label in a muted left gutter, items on the right, ruled. */
.link-block--index .link-cols { width: min(600px, 100%); align-items: stretch; text-align: left; }
.link-block--index .link-col {
  display: grid;
  grid-template-columns: 150px 1fr;
  column-gap: 32px;
  padding: 20px 2px;
  border-top: 1px solid color-mix(in srgb, var(--rule) 65%, transparent);
}
.link-block--index .link-col:last-child { border-bottom: 1px solid color-mix(in srgb, var(--rule) 65%, transparent); }
.link-block--index .link-heading { margin: 3px 0 0; }
.link-block--index .link-item { width: auto; margin: 0 0 9px; }
.link-block--index .link-item:last-child { margin-bottom: 0; }

/* 3 · Inline: each section one centered line, items separated by middots. */
.link-block--inline .link-cols { gap: 30px; text-align: center; max-width: 640px; }
.link-block--inline .link-heading { margin: 0 0 8px; }
.link-block--inline .link-item { display: inline; width: auto; margin: 0; }
.link-block--inline .link-item + .link-item::before { content: "·"; margin: 0 11px 0 9px; opacity: 0.4; }
.link-block--inline .link-item-label { display: inline; }
.link-block--inline .link-item-sub { display: inline; margin-left: 6px; }

/* --- The cog + layout menu (extension page only; the public shell omits them) --- */
.layout-cog {
  position: absolute; top: 18px; right: 18px; z-index: 5;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; padding: 0;
  color: var(--page-fg); opacity: 0.3; cursor: pointer;
  transition: opacity 0.15s ease, transform 0.25s ease;
}
.layout-cog:hover { opacity: 0.85; transform: rotate(30deg); }
.layout-menu {
  position: absolute; top: 54px; right: 18px; z-index: 6;
  width: 236px; padding: 6px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}
.layout-opt {
  display: block; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.layout-opt:hover { background: rgba(0, 0, 0, 0.05); }
.layout-opt .nm { display: flex; justify-content: space-between; font-size: 14.5px; }
.layout-opt[aria-checked="true"] .nm::after { content: "✓"; opacity: 0.7; }
.layout-opt .ds { margin-top: 2px; font: 12px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; opacity: 0.6; }
.link-item {
  display: block;
  /* fit-content + auto margins: <button> items shrink-wrap at the column's left edge
     otherwise (text-align can't center block buttons), which broke the centering. */
  width: fit-content;
  margin: 8px auto;
  font: 400 16px/1.5 "Young Serif", Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  color: var(--page-fg);
  opacity: 0.62;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.link-item:hover { opacity: 1; }
.link-item-label { display: block; }
.link-item:hover .link-item-label { text-decoration: underline; }
/* Optional second line under the label, e.g. "(Acquired)". */
.link-item-sub {
  display: block;
  margin-top: 1px;
  font-style: italic;
  font-size: 0.82em;
  opacity: 0.78;
}
.link-item:hover .link-item-sub { text-decoration: none; }
/* Items that open a popup are <button>s — strip the native chrome so they read like the links. */
button.link-item {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  appearance: none; -webkit-appearance: none; text-align: inherit; width: auto;
}
/* Label-only items (no URL) are plain text, not clickable. */
span.link-item { cursor: default; }
span.link-item:hover { opacity: 0.62; }
span.link-item:hover .link-item-label { text-decoration: none; }
.links-empty { font-style: italic; opacity: 0.55; }

/* --- Item popup: image/video + description shown when a column item is clicked --- */
.item-popup {
  max-width: min(92vw, 620px);
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: fade 0.18s ease;
}
.item-popup-media { width: 100%; max-height: 60vh; object-fit: contain; display: block; border-radius: 14px 14px 0 0; }
.item-popup-body { padding: 18px 20px 22px; }
.item-popup-title { margin: 0 0 8px; font: 600 21px/1.25 Georgia, "Iowan Old Style", Palatino, serif; color: var(--ink); }
.item-popup-desc { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); white-space: pre-wrap; }
.item-popup-link { font: 600 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--accent-deep); text-decoration: none; }
.item-popup-link:hover { text-decoration: underline; }

/* --- Name plate: a big editorial nameplate across the bottom --- */
.name-plate { padding: 24px 20px 10px; text-align: center; }
.name-text {
  margin: 0;
  /* Young Serif: a single chunky display weight, so it reads bold without a 700 variant. */
  font-family: "Young Serif", Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 400;
  font-size: clamp(48px, 12vw, 140px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--page-fg);
  word-break: break-word;
}
.name-text--empty { opacity: 0.32; }

/* --- Inline editor --- */
.editor { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.ed-section { display: flex; flex-direction: column; gap: 12px; }
.ed-field { display: flex; flex-direction: column; gap: 5px; }
.ed-field label {
  font: 600 12px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--page-fg);
  opacity: 0.8;
}
/* All editor inputs sit on cream paper, so their text is always --ink (readable in dark mode too). */
.editor input {
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 9px 11px;
}
.editor input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.ed-groups { display: flex; flex-direction: column; gap: 16px; }
.ed-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
}
.ed-group input { color: var(--ink); }
.ed-group-head { display: flex; gap: 8px; align-items: center; }
/* Grab handle for drag-to-reorder (columns and items). */
.ed-drag {
  border: none;
  background: transparent;
  color: var(--accent-deep);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  cursor: grab;
  opacity: 0.45;
  touch-action: none;
}
.ed-drag:hover { opacity: 1; }
.ed-drag:active { cursor: grabbing; }
.ed-dragging { opacity: 0.4; }
.ed-group-head .ed-heading { flex: 1; font-weight: 700; }
.ed-rows { display: flex; flex-direction: column; gap: 10px; }
/* Each item is a small card: label+URL row, description, then media controls. */
.ed-row {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 8px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
}
/* Handle sits in the left gutter spanning the row; the rest stacks in column 2. */
.ed-row > .ed-drag { grid-row: 1 / -1; align-self: start; margin-top: 4px; }
.ed-row > .ed-row-top,
.ed-row > .ed-sub,
.ed-row > .ed-desc,
.ed-row > .ed-media-row { grid-column: 2; }
.ed-row-top { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.ed-sub, .ed-desc { width: 100%; }

.ed-media-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ed-attach {
  font: 600 13px/1 system-ui, sans-serif;
  color: var(--ink);
  background: transparent;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
}
.ed-attach:hover { border-color: var(--accent); }
.ed-attach:disabled { opacity: 0.6; cursor: progress; }
.ed-media-preview { display: flex; align-items: center; gap: 8px; }
.ed-media-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); }
.ed-media-err { flex-basis: 100%; font: 12px/1.4 system-ui, sans-serif; color: #b3261e; }
.ed-rm-media {
  font: 600 12px/1 system-ui, sans-serif;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.ed-rm-media:hover { background: rgba(0, 0, 0, 0.05); }

.ed-rm-row, .ed-rm-group {
  width: 30px; height: 30px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--accent-deep);
  border-radius: 8px;
  font-size: 16px; line-height: 1;
  cursor: pointer;
}
.ed-rm-row:hover, .ed-rm-group:hover { background: rgba(0, 0, 0, 0.05); }

.ed-add-link, .ed-add-group {
  align-self: flex-start;
  font: 600 13px/1 system-ui, sans-serif;
  background: transparent;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
}
.ed-add-link { color: var(--ink); }        /* inside a paper group card */
.ed-add-group { color: var(--page-fg); }    /* on the page background */
.ed-add-link:hover, .ed-add-group:hover { border-color: var(--accent); }

.ed-actions { display: flex; gap: 10px; margin-top: 6px; }
.ed-btn {
  font: 600 14px/1 system-ui, sans-serif;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.ed-btn.primary { background: var(--accent-deep); color: #fff; border-color: var(--accent-deep); }
.ed-btn.primary:hover { filter: brightness(1.06); }
.ed-btn:disabled { opacity: 0.6; cursor: progress; }
.ed-save-err { margin-top: 8px; font: 13px/1.4 system-ui, sans-serif; color: #b3261e; }

/* --- Responsive --- */
@media (max-width: 720px) {
  /* Columns can't sit three-across on a phone — stack them, dividers off. */
  .link-block--columns .link-cols { flex-direction: column; align-items: center; gap: 30px; }
  .link-block--columns .link-col { padding: 0 20px; }
  .link-block--columns .link-col + .link-col { border-left: 0; }
  /* Index rows: label moves above its items. */
  .link-block--index .link-col { grid-template-columns: 1fr; row-gap: 8px; }
  .link-block--index .link-heading { margin: 0; }
}
@media (max-width: 460px) {
  .ed-row-top { grid-template-columns: 1fr; }
  .ed-row-top .ed-rm-row { justify-self: end; }
}
