:root {
  --ink: #13130f;
  --paper: #e8e4d8;
  --acid: #e8ff47;
  --muted: #77766e;
  --line: rgba(19, 19, 15, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.85), transparent 28%),
    var(--paper);
  font-family: "Manrope", sans-serif;
}

button,
a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 64px, 1480px);
  height: 104px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  font-family: "Russo One", sans-serif;
  font-size: 13px;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.logo-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--acid);
  background: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
}

.header-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #73a61b;
  box-shadow: 0 0 0 4px rgba(115, 166, 27, 0.12);
}

main {
  width: min(100% - 64px, 1480px);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(510px, 1.18fr);
  min-height: calc(100vh - 176px);
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.portrait-wrap {
  position: relative;
  height: calc(100vh - 176px);
  min-height: 610px;
  max-height: 860px;
  align-self: start;
  overflow: hidden;
  background: #252621;
}

.portrait-wrap::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 45%, rgba(16, 17, 14, 0.86) 100%),
    linear-gradient(90deg, rgba(232, 255, 71, 0.12), transparent 42%);
  content: "";
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  filter: grayscale(1) contrast(1.16);
  transform: scale(1.015);
  transition: filter 500ms ease, transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.portrait-wrap:hover .portrait {
  filter: grayscale(0.65) contrast(1.1);
  transform: scale(1.045);
}

.portrait-number {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 25px;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Russo One", sans-serif;
  font-size: 12px;
}

.portrait-caption {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: 27px;
  left: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portrait-caption span:not(:first-child)::before {
  margin-right: 22px;
  color: var(--acid);
  content: "•";
}

.content {
  display: flex;
  min-width: 0;
  padding: 32px clamp(40px, 6vw, 100px) 28px;
  flex-direction: column;
  justify-content: center;
}

.mode-switch {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
}

.mode-button {
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-button.active {
  color: var(--acid);
  background: var(--ink);
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(42px, 6vh, 72px);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow span:first-child {
  display: flex;
  gap: 11px;
  align-items: center;
}

.eyebrow span:first-child::before {
  width: 26px;
  height: 2px;
  background: var(--ink);
  content: "";
}

.category-list {
  display: flex;
  gap: 7px;
  margin-bottom: 33px;
  flex-wrap: wrap;
}

.category-chip {
  padding: 7px 10px;
  border: 1px solid transparent;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: 160ms ease;
}

.category-chip:hover,
.category-chip.active {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.quote-area {
  position: relative;
  max-width: 780px;
  overflow: hidden;
  isolation: isolate;
}

.quote-area.scanning .scan-line {
  animation: scan 620ms cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-area.dramatic .scan-line {
  height: 3px;
  animation: scan-dramatic 1.3s cubic-bezier(0.45, 0, 0.2, 1);
  box-shadow:
    0 0 16px var(--acid),
    0 0 38px rgba(232, 255, 71, 0.75);
}

.quote-area.dramatic::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  opacity: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(232, 255, 71, 0.04) 40%,
    rgba(232, 255, 71, 0.2) 50%,
    rgba(232, 255, 71, 0.04) 60%,
    transparent 100%
  );
  content: "";
  pointer-events: none;
  animation: scan-glow 1.3s ease-in-out;
}

.quote-area.dramatic .quote-mark {
  animation: quote-pulse 1.3s ease-in-out;
}

.scan-line {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  opacity: 0;
  background: var(--acid);
  box-shadow: 0 0 18px var(--acid);
  pointer-events: none;
}

@keyframes scan {
  0% { opacity: 0; transform: translateY(0); }
  18% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(240px); }
}

@keyframes scan-dramatic {
  0% { opacity: 0; transform: translateY(-8px); }
  10% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(320px); }
}

@keyframes scan-glow {
  0% { opacity: 0; transform: translateY(-70%); }
  18% { opacity: 1; }
  82% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(70%); }
}

@keyframes quote-pulse {
  0%, 100% { filter: none; transform: scale(1); }
  45% { filter: drop-shadow(0 0 10px var(--acid)); transform: scale(1.12); }
}

.quote-mark {
  position: absolute;
  top: -72px;
  left: -7px;
  color: var(--acid);
  font-family: Georgia, serif;
  font-size: 124px;
  line-height: 1;
  text-shadow: 1px 1px 0 var(--ink);
}

blockquote {
  position: relative;
  z-index: 1;
  min-height: 3em;
  margin: 0;
  font-family: "Russo One", sans-serif;
  font-size: clamp(32px, 3.9vw, 65px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
  transition: opacity 360ms ease, transform 360ms ease, filter 360ms ease;
}

blockquote.changing {
  opacity: 0.12;
  filter: blur(3px);
  transform: translateY(8px) scale(0.985);
}

.quote-meta {
  display: flex;
  margin-top: 24px;
  gap: 15px;
  align-items: center;
}

.signature {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.category-badge {
  padding: 5px 8px;
  color: var(--ink);
  background: var(--acid);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 56px auto auto;
  gap: 10px;
  max-width: 720px;
  margin-top: clamp(40px, 6vh, 68px);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  display: flex;
  min-width: 230px;
  min-height: 56px;
  padding: 20px 22px;
  align-items: center;
  justify-content: space-between;
  color: var(--acid);
  background: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover {
  box-shadow: 7px 7px 0 var(--acid);
  transform: translate(-3px, -3px);
}

.primary-button:active {
  box-shadow: 2px 2px 0 var(--acid);
  transform: translate(0, 0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.92;
  box-shadow: inset 0 -3px 0 rgba(232, 255, 71, 0.4);
  transform: none;
}

.primary-button:disabled svg {
  animation: arrow-wait 700ms ease-in-out infinite alternate;
}

@keyframes arrow-wait {
  from { transform: translateX(-4px); opacity: 0.45; }
  to { transform: translateX(4px); opacity: 1; }
}

.primary-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.8;
}

.secondary-button,
.icon-button {
  display: flex;
  padding: 18px 21px;
  min-height: 56px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease;
}

.secondary-button:hover,
.icon-button:hover,
.icon-button.active {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.32);
}

.secondary-button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  max-width: 17px;
  max-height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.icon-button {
  width: 56px;
  min-width: 56px;
  padding: 17px;
  justify-content: center;
}

.icon-button.active svg {
  fill: var(--ink);
}

.compact-action {
  padding-right: 17px;
  padding-left: 17px;
}

.under-actions {
  display: flex;
  gap: 15px 24px;
  margin-top: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.hint strong {
  color: var(--ink);
}

.counter {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.counter span {
  color: var(--ink);
  font-weight: 700;
}

.favorites-link {
  padding: 0 0 2px;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.favorites-link span {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  color: var(--acid);
  background: var(--ink);
  font-size: 8px;
}

dialog {
  width: min(92vw, 650px);
  max-height: 82vh;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 18px 18px 0 rgba(232, 255, 71, 0.82);
}

dialog::backdrop {
  background: rgba(10, 10, 8, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-head {
  display: flex;
  padding: 28px 30px 22px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 5px 0 0;
  font-family: "Russo One", sans-serif;
  font-size: 25px;
}

.dialog-kicker {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dialog-close {
  width: 38px;
  height: 38px;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

.favorites-list {
  overflow-y: auto;
  max-height: 55vh;
  padding: 8px 30px 25px;
}

.favorite-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.favorite-item p {
  margin: 0;
  font-family: "Russo One", sans-serif;
  font-size: 15px;
  line-height: 1.35;
}

.favorite-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.favorite-remove {
  align-self: start;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.favorites-empty {
  padding: 36px 30px 42px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.favorites-empty[hidden] {
  display: none;
}

.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 28px 30px 32px;
}

.share-options button {
  min-height: 56px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-options button:first-child {
  color: var(--acid);
  background: var(--ink);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 13px 17px;
  opacity: 0;
  color: var(--acid);
  background: var(--ink);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  display: flex;
  width: min(100% - 64px, 1480px);
  min-height: 72px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .site-header,
  main,
  footer {
    width: min(100% - 32px, 680px);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 16px;
  }

  .portrait-wrap {
    height: min(58vh, 560px);
    min-height: 48vh;
    max-height: 560px;
  }

  .portrait {
    object-position: center 20%;
  }

  .content {
    padding: 48px 8px 60px;
  }

  .eyebrow {
    margin-bottom: 55px;
  }

  blockquote {
    min-height: 0;
  }

  footer {
    padding: 22px 0;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 84px;
  }

  .header-meta {
    display: none;
  }

  .portrait-wrap {
    height: 420px;
    min-height: 420px;
  }

  .portrait-caption {
    gap: 7px 12px;
  }

  .portrait-caption span:not(:first-child)::before {
    margin-right: 12px;
  }

  .eyebrow {
    margin-bottom: 48px;
  }

  .eyebrow #current-date {
    display: none;
  }

  blockquote {
    font-size: clamp(30px, 9vw, 44px);
  }

  .actions {
    margin-top: 54px;
    grid-template-columns: minmax(0, 1fr) 56px 56px 56px;
  }

  .primary-button {
    width: auto;
    min-width: 0;
    justify-content: space-between;
  }

  .icon-button {
    width: 56px;
  }

  .secondary-button,
  .compact-action {
    width: 56px;
    min-width: 56px;
    padding: 0;
    justify-content: center;
  }

  .secondary-button span {
    display: none;
  }

  .category-list {
    margin-right: -8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-list::-webkit-scrollbar {
    display: none;
  }

  .share-options {
    grid-template-columns: 1fr;
  }

  dialog {
    box-shadow: 8px 8px 0 rgba(232, 255, 71, 0.82);
  }
}

@media (min-width: 561px) and (max-width: 1200px) {
  .actions {
    grid-template-columns: minmax(210px, 1fr) repeat(3, 56px);
  }

  .secondary-button,
  .compact-action {
    width: 56px;
    min-width: 56px;
    padding: 0;
    justify-content: center;
  }

  .secondary-button span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
