/* Forma — blueprint direction: navy drafting field, cyan ink, mono annotations */

:root {
  --bg: #0c1d36;
  --surface: #10284a;
  --surface-2: #163159;
  --ink: #e9f2fb;
  --muted: #9fb6d1;
  --rule: #2b4a75;
  --accent: #5fd3f0;
  --accent-ink: #06172b;
  --warn: #f4c26b;

  --font-display: Futura, "Century Gothic", "Trebuchet MS", "Avenir Next Condensed", sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, "SFMono-Regular", monospace;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --r: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  background-image:
    linear-gradient(rgba(95, 211, 240, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 211, 240, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: clip;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

p {
  margin: 0;
  max-width: 62ch;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 10;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  text-decoration: none;
}

.skip-link:focus-visible {
  top: var(--s-3);
}

.wrap {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  padding-block: var(--s-3);
}

.brand-mark {
  width: 22px;
  height: 22px;
  flex: none;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

.header-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}

.header-meta a:active {
  transform: scale(0.97);
}

.brand:focus-visible,
.header-meta a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.saved-count {
  color: var(--accent);
}

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

.hero {
  position: relative;
  padding-block: var(--s-9) var(--s-8);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: var(--s-7);
  align-items: end;
}

.hero-kicker {
  color: var(--accent);
  margin-bottom: var(--s-5);
}

.hero h1 {
  font-size: clamp(44px, 6.4vw, 92px);
}

.hero-lede {
  margin-top: var(--s-5);
  font-size: 19px;
  color: var(--muted);
}

.hero-plan {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  width: 100%;
  justify-self: end;
}

.hero-plan svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.plan-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw 1200ms var(--ease) forwards;
}

.plan-dim {
  stroke: var(--muted);
  stroke-width: 1;
  fill: none;
  opacity: 0;
  animation: fade 500ms var(--ease) 700ms forwards;
}

.plan-count {
  position: absolute;
  right: 0;
  top: -96px;
  font-family: var(--font-display);
  font-size: clamp(120px, 14vw, 200px);
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: var(--accent);
  opacity: 0;
  animation: fade 600ms var(--ease) 500ms forwards;
  pointer-events: none;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes fade {
  to { opacity: 1; }
}

/* ---------- toolbar ---------- */

.browse {
  padding-block: var(--s-9) var(--s-9);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
}

.section-head h2 {
  font-size: clamp(32px, 4vw, 48px);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: end;
  padding-block: var(--s-5);
  border-block: 1px solid var(--rule);
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: var(--s-7);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 48px;
  padding: var(--s-3) var(--s-5);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}

.toggle::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition: background-color 200ms var(--ease);
}

.toggle[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.toggle[aria-pressed="true"]::before {
  background: currentColor;
}

.toggle:active {
  transform: scale(0.97);
}

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

@media (hover: hover) and (pointer: fine) {
  .toggle:hover {
    background: rgba(95, 211, 240, 0.14);
  }

  .toggle[aria-pressed="true"]:hover {
    background: #8ae3f7;
  }
}

.status-line {
  margin-top: var(--s-4);
  color: var(--muted);
  min-height: 1.6em;
}

/* ---------- list ---------- */

.list {
  list-style: none;
  margin: var(--s-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}

.item:nth-child(3n + 2) {
  margin-top: var(--s-7);
}

.item-figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.item-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.02);
  transition: transform 400ms var(--ease);
}

.item-tag {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  padding: var(--s-1) var(--s-3);
  background: var(--bg);
  color: var(--accent);
}

.item-body {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
}

.item-body h3 {
  font-size: 30px;
}

.item-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin: 0;
  padding: var(--s-4) 0 0;
  border-top: 1px dashed var(--rule);
}

.item-facts div {
  display: grid;
  gap: 2px;
}

.item-facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-facts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
}

.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.item-foot .price {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.open-item {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--s-3) var(--s-5);
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 200ms var(--ease), background-color 200ms var(--ease);
}

.open-item:active {
  transform: scale(0.97);
}

.open-item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.item.is-passed .open-item {
  background: transparent;
  color: var(--accent);
}

.item-status,
.item-saved {
  position: absolute;
  bottom: var(--s-4);
  padding: var(--s-1) var(--s-3);
  background: var(--bg);
  font-size: 11px;
}

.item-status {
  left: var(--s-4);
  color: var(--warn);
}

.item-saved {
  right: var(--s-4);
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 700;
}

.item-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: var(--s-4);
}

.plan-line-2 {
  animation-delay: 300ms;
}

.plan-text {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--muted);
  letter-spacing: 0.06em;
}

.visit {
  padding-block: var(--s-8);
  border-top: 1px solid var(--rule);
}

.visit h2 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: var(--s-4);
}

@media (hover: hover) and (pointer: fine) {
  .item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }

  .item:hover .item-figure img {
    transform: scale(1.02);
  }

  .open-item:hover {
    background: #8ae3f7;
  }

  .item.is-passed .open-item:hover {
    background: rgba(95, 211, 240, 0.14);
  }
}

.item:focus-within {
  border-color: var(--accent);
}

/* ---------- empty state ---------- */

.empty-state {
  margin-top: var(--s-6);
  padding: var(--s-7) var(--s-6);
  border: 1px dashed var(--accent);
  border-radius: var(--r);
  display: grid;
  justify-items: start;
  gap: var(--s-4);
}

.empty-state h3 {
  font-size: 32px;
}

.text-btn {
  min-height: 44px;
  padding: var(--s-3) var(--s-5);
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-btn:active {
  transform: scale(0.97);
}

.text-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .text-btn:hover {
    background: #8ae3f7;
  }
}

/* ---------- detail dialog ---------- */

.detail {
  width: min(960px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  overflow: auto;
}

.detail::backdrop {
  background: rgba(4, 12, 24, 0.78);
}

.detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}

.detail-figure {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--rule);
}

.detail-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-text {
  display: grid;
  align-content: start;
  gap: var(--s-5);
  padding: var(--s-7) var(--s-6);
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--s-4);
}

.detail h2 {
  font-size: clamp(34px, 4vw, 48px);
}

.detail-body {
  font-size: 18px;
  line-height: 1.65;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-5);
  margin: 0;
  padding: var(--s-5) 0 0;
  border-top: 1px solid var(--rule);
}

.detail-meta div {
  display: grid;
  gap: 2px;
}

.detail-meta dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-meta dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.close-detail {
  min-height: 44px;
  padding: var(--s-3) var(--s-4);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: none;
}

.close-detail:active {
  transform: scale(0.97);
}

.close-detail:focus-visible,
.save-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.save-item {
  min-height: 48px;
  padding: var(--s-3) var(--s-5);
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}

.save-item[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.save-item:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .close-detail:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .save-item:hover {
    background: rgba(95, 211, 240, 0.14);
  }

  .save-item[aria-pressed="true"]:hover {
    background: #8ae3f7;
  }
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-8);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-5);
}

.site-footer p {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- responsive ---------- */

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

  .hero-plan {
    justify-self: start;
    max-width: 280px;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar .toggle {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .list {
    grid-template-columns: 1fr;
  }

  .item:nth-child(3n + 2) {
    margin-top: 0;
  }

  .detail-inner {
    grid-template-columns: 1fr;
  }

  .detail-figure {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding-block: var(--s-7) var(--s-6);
  }

  .hero-plan {
    display: none;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .header-meta a {
    font-size: 13px;
  }

  .item-body {
    padding: var(--s-4);
  }

  .item-facts {
    grid-template-columns: 1fr 1fr;
  }

  .detail-text {
    padding: var(--s-5) var(--s-4);
  }

  .detail-meta {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .plan-line,
  .plan-dim,
  .plan-count {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }

  .item,
  .item-figure img,
  .toggle,
  .open-item,
  .save-item,
  .close-detail,
  .text-btn {
    transition: none;
  }

  .item:hover,
  .open-item:active,
  .toggle:active,
  .save-item:active,
  .close-detail:active,
  .text-btn:active {
    transform: none;
  }
}
