/* ============================================================
   components.css — log detail page components
   ============================================================ */

/* ---- Breadcrumb (sticky) ---- */
.log-breadcrumb {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0;
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-xs);
  color: var(--ink-sub);
  letter-spacing: 0.04em;
  background: rgba(253, 247, 245, 0.85);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-breadcrumb-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-breadcrumb a {
  color: var(--ink-sub);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.log-breadcrumb a:hover {
  color: var(--couple-primary, var(--rose-deep));
}
.log-breadcrumb .sep {
  margin: 0 8px;
  color: var(--ink-light);
  flex-shrink: 0;
}
.log-breadcrumb .current {
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ---- Page container ---- */
.log-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--s-4) var(--s-8);
}

/* ---- Hero / cover ---- */
.log-hero {
  position: relative;
  height: clamp(360px, 55vh, 520px);
  overflow: hidden;
  margin: 0 calc(-1 * var(--s-4)) var(--s-7);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  isolation: isolate;
}
.log-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-x, 50%) var(--hero-y, 35%);
  z-index: 1;
}
.log-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(74, 58, 68, 0)   0%,
      rgba(74, 58, 68, 0.05) 45%,
      rgba(74, 58, 68, 0.80) 100%);
  z-index: 2;
}
.log-hero-text {
  position: absolute;
  z-index: 3;
  bottom: var(--s-6);
  left: var(--s-6);
  right: var(--s-6);
  color: #fff;
}
.log-archive-no {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: var(--s-2);
}
.log-archive-no::before {
  content: "✦ ";
  color: var(--peach);
}
.log-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 6px;
  color: #fff;                /* override base.css h1 ink color */
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.log-subtitle {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-style: italic;
  opacity: 0.96;
  margin-bottom: var(--s-4);
}
.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.log-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---- Profile cards ---- */
.log-profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.log-profile-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  box-shadow: var(--shadow);
  transition: transform var(--dur-base) var(--ease);
}
.log-profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-up);
}
.log-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--rose));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  flex-shrink: 0;
}
.log-profile-card.role-user .log-profile-avatar {
  background: linear-gradient(135deg, var(--sky), var(--lilac));
}
.log-profile-info { min-width: 0; }
.log-profile-role {
  font-size: 10px;
  color: var(--ink-sub);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 2px;
}
.log-profile-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--ink);
}

/* ---- Meta bar (Play Bar style) ---- */
.log-metabar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: var(--s-3) var(--s-5);
  box-shadow: var(--shadow);
  margin-bottom: var(--s-7);
}
.log-metabar-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff;
  font-size: var(--text-xs);
  flex-shrink: 0;
}
.log-metabar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--ink-sub);
  font-weight: 600;
}
.log-metabar-item-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-light);
}
.log-metabar-item-value {
  color: var(--ink);
  font-weight: 700;
}
.log-metabar-item a {
  color: var(--rose-deep);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.log-metabar-divider {
  color: var(--ink-light);
  user-select: none;
  opacity: 0.6;
}

/* ---- Storyline (story so far) ---- */
.log-storyline {
  background: var(--surface-2);
  border-left: 3px solid var(--lilac);
  padding: var(--s-4) var(--s-5);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: var(--s-7);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-sub);
  line-height: var(--leading-loose);
}
.log-storyline::before {
  content: "✿ ";
  color: var(--lilac);
}

/* ---- Body — message stream ---- */
.log-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

.msg {
  display: flex;
  flex-direction: column;
}
.msg--char {
  align-items: flex-start;
}
.msg--user {
  align-items: flex-end;
}

.msg-speaker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-sub);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
  padding: 0 var(--s-2);
}
.msg-speaker::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--rose);
  border-radius: 1px;
}
.msg--user .msg-speaker::before {
  background: var(--lilac);
}

.msg-num {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  text-transform: none;
}

.msg-bubble {
  max-width: 88%;
  padding: var(--s-5) var(--s-5);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--ink);
}
.msg--char .msg-bubble {
  background: linear-gradient(180deg, #ffffff 0%, #fff7f9 100%);
  border-color: rgba(238, 122, 166, 0.22);
  border-top-left-radius: var(--r-sm);
}
.msg--user .msg-bubble {
  background: linear-gradient(180deg, #ffffff 0%, #f8f2ff 100%);
  border-color: rgba(196, 168, 224, 0.32);
  border-top-right-radius: var(--r-sm);
  max-width: 75%;
}
.msg-bubble p {
  margin-bottom: var(--s-3);
}
.msg-bubble p:last-child { margin-bottom: 0; }

/* ---- Section headers (## / ###) ---- */
.log-section-header {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--rose-deep);
  letter-spacing: 0.05em;
  margin: var(--s-5) 0 var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.log-section-header::before {
  content: "";
  flex: 0 0 24px;
  height: 1px;
  background: var(--line-strong);
}
.log-section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.log-subheader {
  font-size: var(--text-xs);
  color: var(--lilac-deep);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  margin: var(--s-4) 0 var(--s-2);
}

/* ---- Dialogue (Korean curly double quote) ---- */
.dialogue {
  font-weight: 700;
  background: linear-gradient(180deg,
    transparent 55%,
    rgba(255, 213, 194, 0.62) 55%,
    rgba(255, 213, 194, 0.62) 95%,
    transparent 95%);
  padding: 0 2px;
  border-radius: 2px;
  color: var(--ink);
}
.msg--user .dialogue {
  background: linear-gradient(180deg,
    transparent 55%,
    rgba(206, 228, 245, 0.7) 55%,
    rgba(206, 228, 245, 0.7) 95%,
    transparent 95%);
}

/* ---- Thought (Korean curly single quote) ---- */
.thought {
  font-style: italic;
  color: var(--lilac-deep);
  background: rgba(232, 213, 245, 0.35);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.96em;
}

/* ---- Italic emphasis (*..*) ---- */
.msg-bubble em {
  font-style: italic;
  color: var(--ink-sub);
}

/* ---- GigaTrans block ---- */
.gigatrans {
  margin: var(--s-3) 0;
}
.gigatrans-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--lilac-deep);
  background: rgba(196, 168, 224, 0.08);
  border: 1px dashed var(--lilac);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all var(--dur-fast) var(--ease);
}
.gigatrans-toggle::before {
  content: "🌐";
  font-size: 11px;
}
.gigatrans-toggle:hover {
  background: var(--lilac);
  color: #fff;
  transform: translateY(-1px);
}
.gigatrans-toggle[aria-expanded="true"] {
  background: var(--lilac);
  color: #fff;
}
.gigatrans-content {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(232, 213, 245, 0.18);
  border-left: 2px solid var(--lilac);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--ink-sub);
  line-height: 1.7;
}
.gigatrans-content[hidden] { display: none; }
.gigatrans-content p { margin-bottom: var(--s-2); }
.gigatrans-content p:last-child { margin-bottom: 0; }

/* ---- Footer ---- */
.log-footer {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px dashed var(--line-strong);
  text-align: center;
}
.log-footer-glyphs {
  font-size: var(--text-md);
  color: var(--rose);
  letter-spacing: 0.5em;
  margin-bottom: var(--s-3);
}
.log-footer-credits {
  font-size: var(--text-xs);
  color: var(--ink-light);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.log-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding: var(--s-2) var(--s-4);
  font-size: var(--text-xs);
  color: var(--rose-deep);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-weight: 700;
  transition: all var(--dur-fast) var(--ease);
}
.log-back:hover {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
  transform: translateY(-1px);
}

/* ---- Mobile (log detail) ---- */
@media (max-width: 640px) {
  .log-hero { margin: 0 calc(-1 * var(--s-3)) var(--s-6); height: 360px; }
  .log-hero-text { left: var(--s-4); right: var(--s-4); bottom: var(--s-4); }
  .log-profiles { grid-template-columns: 1fr; gap: var(--s-3); }
  .log-metabar { padding: var(--s-3); border-radius: var(--r-md); }
  .msg-bubble { max-width: 95%; padding: var(--s-4); }
  .msg--user .msg-bubble { max-width: 92%; }
}

/* ============================================================
   COUPLE PAGE COMPONENTS
   ============================================================ */

/* ---- Top nav (sticky) ---- */
.couple-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0;
  padding: var(--s-3) var(--s-5);
  background: rgba(253, 247, 245, 0.85);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.couple-nav-back {
  display: inline-block;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  font-size: var(--text-xs);
  color: var(--ink-sub);
  letter-spacing: 0.04em;
  font-weight: 600;
  text-decoration: none;
}
.couple-nav-back:hover {
  color: var(--couple-primary, var(--rose-deep));
}

/* ---- Page container ---- */
.couple-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--s-5) var(--s-8);
}

/* ---- Hero ---- */
.couple-hero {
  position: relative;
  margin: var(--s-4) calc(-1 * var(--s-5)) var(--s-7);
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  height: clamp(380px, 58vh, 540px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.couple-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--couple-hero-x, 50%) var(--couple-hero-y, 50%);
  z-index: 0;
}
.couple-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(0,0,0,0)   30%,
      rgba(0,0,0,0.20) 60%,
      rgba(0,0,0,0.65) 100%);
}
/* Fallback: if no image, show themed gradient */
.couple-hero:not(.has-image) .couple-hero-overlay {
  background:
    radial-gradient(ellipse at top left,
      var(--couple-accent, var(--peach)) 0%, transparent 60%),
    radial-gradient(ellipse at bottom right,
      var(--couple-primary, var(--rose)) 0%,
      var(--couple-primary-deep, var(--rose-deep)) 80%);
}
.couple-hero:not(.has-image) .couple-hero-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.28) 1px, transparent 1px);
  background-size: 16px 16px;
  mix-blend-mode: overlay;
  opacity: 0.5;
}
.couple-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-7) var(--s-5);
  text-align: center;
}

.couple-hero-portraits {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.portrait {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  background: #fff;
  transition: transform var(--dur-base) var(--ease);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.portrait:hover {
  transform: translateY(-3px);
}
.couple-hero-x {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: rgba(255,255,255,0.85);
  font-weight: 200;
}

.couple-hero-text {
  text-align: center;
  color: #fff;
}
.couple-hero-bracket {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-bottom: var(--s-2);
}
.couple-hero-alias {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--s-2);
  color: #fff;                /* override base.css h1 ink color */
  text-shadow: 0 2px 16px rgba(0,0,0,0.50);
  letter-spacing: -0.01em;
}
.couple-hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-md);
  opacity: 0.95;
  margin-bottom: var(--s-3);
}
.couple-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
}

/* ---- Tag chips ---- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.couple-hero-tags .tag {
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tag--sm { padding: 2px 10px; font-size: 11px; }
.tag--xs { padding: 1px 8px; font-size: 10px; }

/* ---- Profile cards ---- */
.couple-profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
.profile-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--s-4);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-up);
}
.profile-card.role-char {
  border-left: 4px solid var(--couple-primary, var(--rose));
}
.profile-card.role-persona {
  border-left: 4px solid var(--couple-accent, var(--lilac));
}
.profile-image {
  width: 100px;
  height: 100px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.profile-image-fallback {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--couple-primary, var(--rose));
}
.profile-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.profile-role {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--ink-sub);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.profile-name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--s-2);
}
.profile-bio {
  font-size: var(--text-sm);
  color: var(--ink-sub);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: var(--s-2);
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.profile-tags .tag--sm {
  background: var(--surface-2);
  color: var(--ink-sub);
}

/* ---- Section header (shared) ---- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 1px dashed var(--line);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--couple-primary-deep, var(--rose-deep));
  font-weight: 700;
  letter-spacing: 0.02em;
}
.section-glyphs {
  font-size: var(--text-xs);
  color: var(--ink-light);
  letter-spacing: 0.4em;
}

/* ---- Anniversaries ---- */
.couple-anniversaries {
  margin-bottom: var(--s-7);
}
.anniv-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  list-style: none;
}
.anniv-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease);
}
.anniv-item:hover {
  transform: translateY(-1px);
  border-color: var(--couple-primary, var(--rose));
}
.anniv-glyph {
  color: var(--couple-primary, var(--rose));
  font-size: var(--text-md);
}
.anniv-label {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ink);
}
.anniv-date {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--ink-sub);
  letter-spacing: 0.06em;
  padding-left: var(--s-2);
  border-left: 1px solid var(--line);
}

/* ---- Logs gallery ---- */
.couple-logs {
  margin-bottom: var(--s-6);
}
.couple-logs-count {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--ink-sub);
  letter-spacing: 0.08em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px 10px;
}
.couple-logs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-4);
}
.couple-logs-empty {
  text-align: center;
  color: var(--ink-sub);
  font-style: italic;
  padding: var(--s-6);
  background: var(--surface-2);
  border-radius: var(--r-md);
}

/* ---- Log card ---- */
.log-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
  text-decoration: none;
  color: inherit;
}
.log-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-up);
  border-color: var(--couple-primary, var(--rose));
}
.log-card-img {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center 30%;
}
.log-card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.15) 100%);
}
.log-card-lock {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  z-index: 1;
  background: rgba(255,255,255,0.94);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.log-card-lock--soft {
  background: var(--surface-2);
  color: var(--ink-sub);
}
.log-card-body {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.log-card-no {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--couple-primary-deep, var(--rose-deep));
  text-transform: uppercase;
  margin-bottom: 4px;
}
.log-card-title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.3;
}
.log-card-subtitle {
  font-size: var(--text-sm);
  color: var(--ink-sub);
  font-style: italic;
  margin-bottom: var(--s-3);
  line-height: 1.5;
}
.log-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
}
.log-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.log-card-tags .tag--xs {
  background: var(--surface-2);
  color: var(--ink-sub);
}
.log-card-date {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--ink-light);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---- Floating BGM widget ---- */
.couple-bgm {
  position: fixed;
  bottom: var(--s-4);
  right: var(--s-4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s-2);
}
.couple-bgm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--couple-primary, var(--rose));
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--couple-primary-deep, var(--rose-deep));
  letter-spacing: 0.08em;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.couple-bgm-toggle:hover {
  background: var(--couple-primary, var(--rose));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-up);
}
.couple-bgm-toggle[aria-expanded="true"] {
  background: var(--couple-primary, var(--rose));
  color: #fff;
}
.bgm-icon {
  font-size: var(--text-md);
}
.couple-bgm-player {
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-up);
  border: 1.5px solid var(--couple-primary, var(--rose));
}
.couple-bgm-player iframe {
  display: block;
}
.couple-bgm-player[hidden] {
  display: none;
}

/* ---- Mobile (couple page) ---- */
@media (max-width: 640px) {
  .couple-page { padding: 0 var(--s-3) var(--s-7); }
  .couple-nav { padding: var(--s-3) var(--s-3) 0; }
  .couple-hero {
    margin: var(--s-3) calc(-1 * var(--s-3)) var(--s-5);
    min-height: 320px;
    padding: var(--s-5) var(--s-4);
  }
  .portrait { width: 88px; height: 88px; border-width: 3px; }
  .couple-hero-x { font-size: var(--text-xl); }
  .couple-hero-portraits { gap: var(--s-2); }
  .couple-profiles { grid-template-columns: 1fr; gap: var(--s-3); }
  .profile-card {
    grid-template-columns: 80px 1fr;
    gap: var(--s-3);
    padding: var(--s-3);
  }
  .profile-image { width: 80px; height: 80px; }
  .anniv-list { flex-direction: column; }
  .anniv-item { width: 100%; }
  .couple-logs-grid { grid-template-columns: 1fr; }
  .couple-bgm { bottom: var(--s-3); right: var(--s-3); }
  .couple-bgm-player iframe { width: 280px; height: 158px; }
}

/* ============================================================
   HOME PAGE
   ============================================================ */

.home-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-5) var(--s-8);
}

.home-header {
  text-align: center;
  margin-bottom: var(--s-6);
}
.home-glyphs {
  font-size: var(--text-md);
  color: var(--rose);
  letter-spacing: 0.5em;
  margin-bottom: var(--s-3);
}
.home-glyphs--top {
  color: var(--rose-deep);
  opacity: 0.7;
}
.home-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  font-weight: 700;
  color: var(--rose-deep);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  text-shadow: 0 2px 0 var(--surface-2);
}
.home-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--ink-sub);
}

.home-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-bottom: var(--s-7);
}
.home-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--s-3) var(--s-5);
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(238, 122, 166, 0.30);
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.home-control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(238, 122, 166, 0.42);
  color: #fff;
}
.home-control-btn--ghost {
  background: var(--surface);
  color: var(--rose-deep);
  border: 1.5px solid var(--rose);
  box-shadow: var(--shadow);
}
.home-control-btn--ghost:hover {
  background: var(--surface-2);
  color: var(--rose-deep);
}
.home-control-btn .btn-glyph {
  font-size: var(--text-md);
}

.home-footer {
  text-align: center;
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px dashed var(--line);
}
.home-footer-credits {
  font-size: var(--text-xs);
  color: var(--ink-light);
  font-weight: 600;
  margin-top: var(--s-2);
}

/* ---- Couple grid ---- */
.couples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--s-5);
}
.couples-empty {
  text-align: center;
  color: var(--ink-sub);
  font-style: italic;
  padding: var(--s-7);
  background: var(--surface-2);
  border-radius: var(--r-md);
}

.couple-grid-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
  isolation: isolate;
}
.couple-grid-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-up);
  border-color: var(--couple-primary, var(--rose));
}
.couple-grid-card--pinned {
  border-color: var(--couple-primary, var(--rose));
  border-width: 2px;
}

.couple-grid-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center 35%;
}
.couple-grid-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 50%,
    rgba(0,0,0,0.18) 100%);
}
.couple-grid-card-pin {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #ffe9b0, #ffd089);
  color: #8a5a00;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border-radius: var(--r-pill);
  box-shadow: 0 4px 12px rgba(218, 165, 32, 0.35);
}
.couple-grid-card-lock {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  z-index: 2;
  background: rgba(255,255,255,0.94);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.couple-grid-card-lock.soft {
  background: rgba(255,255,255,0.78);
  color: var(--ink-sub);
}

/* ---- Locked (password) card — minimal, no identifying info ---- */
.couple-grid-card--locked {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  border-color: var(--couple-primary, var(--rose));
}
.lock-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg,
    var(--couple-primary, var(--rose)) 0%,
    var(--couple-primary-deep, var(--rose-deep)) 100%);
}
.lock-card-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.20) 1px, transparent 1px);
  background-size: 16px 16px;
  mix-blend-mode: overlay;
  opacity: 0.7;
}
.lock-card-content {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--s-6) var(--s-5);
  color: #fff;
}
.lock-card-icon {
  font-size: 44px;
  margin-bottom: var(--s-3);
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
}
.lock-card-label {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
  margin-bottom: var(--s-3);
}
.lock-card-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  opacity: 0.92;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
  max-width: 88%;
  line-height: 1.5;
}
.couple-grid-card--locked:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-up);
}
/* Make sure locked cards don't try to render image background */
.couple-grid-card--locked .lock-card-content > * {
  pointer-events: none;
}

.couple-grid-card-body {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
}
.couple-grid-card-bracket {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  color: var(--couple-primary, var(--rose));
  font-style: italic;
}
.couple-grid-card-alias {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
.couple-grid-card-tagline {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--ink-sub);
  line-height: 1.5;
}
.couple-grid-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.couple-grid-card-tags .tag--xs {
  background: var(--surface-2);
  color: var(--couple-primary-deep, var(--rose-deep));
  border: 1px solid var(--line);
}

.couple-grid-card-annivs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: var(--s-2) 0;
  border-top: 1px dashed var(--line);
}
.anniv-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--ink-sub);
}
.anniv-mini-glyph {
  color: var(--couple-primary, var(--rose));
  font-size: 13px;
}
.anniv-mini-label {
  font-weight: 700;
  color: var(--ink);
}
.anniv-mini-date {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--ink-light);
}

.couple-grid-card-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.meta-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.06em;
  background: var(--surface-2);
  color: var(--ink-sub);
  border: 1px solid var(--line);
}
.meta-pill--accent {
  background: var(--couple-primary, var(--rose));
  color: #fff;
  border-color: transparent;
}

/* ============================================================
   CHRONICLE PAGE
   ============================================================ */

.chronicle-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: var(--s-3) var(--s-5);
  background: rgba(253, 247, 245, 0.85);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.chronicle-nav-back {
  display: inline-block;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  font-size: var(--text-xs);
  color: var(--ink-sub);
  letter-spacing: 0.04em;
  font-weight: 600;
  text-decoration: none;
}
.chronicle-nav-back:hover {
  color: var(--rose-deep);
}

.chronicle-page {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-5) var(--s-8);
}

.chronicle-header {
  text-align: center;
  margin-bottom: var(--s-7);
}
.chronicle-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--rose-deep);
  margin: var(--s-3) 0 6px;
  letter-spacing: -0.01em;
}
.chronicle-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-sub);
  font-size: var(--text-sm);
}

.chronicle-timeline {
  list-style: none;
  position: relative;
  margin: 0;
  padding-left: 0;
}
.chronicle-timeline::before {
  content: "";
  position: absolute;
  left: 102px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0,
    var(--line-strong) 8%,
    var(--line-strong) 92%,
    transparent 100%);
}

.chronicle-entry {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: var(--s-5);
  padding: var(--s-4) 0;
  position: relative;
}
.chronicle-entry::before {
  content: "✿";
  position: absolute;
  left: 92px;
  top: var(--s-5);
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  background: var(--bg);
  color: var(--couple-primary, var(--rose));
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--couple-primary, var(--rose));
  font-size: 11px;
  z-index: 1;
}

.chronicle-entry-date {
  text-align: right;
  padding-top: var(--s-4);
}
.chronicle-entry-date-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  color: var(--ink-sub);
  font-weight: 700;
}

.chronicle-entry-content {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-left: 3px solid var(--couple-primary, var(--rose));
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.chronicle-entry-content:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-up);
}

.chronicle-entry-couple {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--couple-primary-deep, var(--rose-deep));
  text-decoration: none;
  margin-bottom: 4px;
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}
.chronicle-entry-couple:hover {
  background: var(--couple-primary, var(--rose));
  color: #fff;
  border-color: transparent;
}

.chronicle-entry-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.chronicle-entry-title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink);
  margin: 6px 0 var(--s-3);
  line-height: 1.4;
}
.chronicle-entry-link:hover .chronicle-entry-title {
  color: var(--couple-primary-deep, var(--rose-deep));
}
.chronicle-entry-subtitle {
  font-style: italic;
  color: var(--ink-sub);
  font-weight: 400;
  font-size: var(--text-sm);
}
.chronicle-entry-lock {
  font-size: 0.9em;
  opacity: 0.8;
}
.chronicle-entry-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  justify-content: space-between;
}
.chronicle-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chronicle-entry-tags .tag--xs {
  background: var(--surface-2);
  color: var(--ink-sub);
}
.chronicle-entry-archive {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-light);
  text-transform: uppercase;
}

.chronicle-empty {
  list-style: none;
  text-align: center;
  font-style: italic;
  color: var(--ink-sub);
  padding: var(--s-7);
}

/* ---- Mobile (home + chronicle) ---- */
@media (max-width: 640px) {
  .home-page { padding: var(--s-5) var(--s-3) var(--s-7); }
  .couples-grid {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .couple-grid-card-body { padding: var(--s-4); }

  .chronicle-page { padding: var(--s-5) var(--s-3) var(--s-7); }
  .chronicle-timeline::before {
    left: 16px;
  }
  .chronicle-entry {
    grid-template-columns: 1fr;
    gap: var(--s-2);
    padding-left: 36px;
  }
  .chronicle-entry::before {
    left: 16px;
    top: var(--s-3);
  }
  .chronicle-entry-date {
    text-align: left;
    padding-top: 0;
  }
  .chronicle-entry-content { padding: var(--s-3) var(--s-4); }
}
