:root {
  --ink: #122018;
  --paper: #f3efe6;
  --panel: #fffdf8;
  --accent: #d4ff3f;
  --accent-ink: #1a2a12;
  --line: rgba(18, 32, 24, 0.14);
  --muted: rgba(18, 32, 24, 0.62);
  --shadow: 0 18px 50px rgba(18, 32, 24, 0.12);
  /* Search tray + card surfaces — card must be much lighter than the well. */
  --well: #dcd7c7;
  --well-edge: rgba(18, 32, 24, 0.22);
  --card-fill: #ffffff;
  --hairline: rgba(18, 32, 24, 0.10);
  --card-edge: 2px solid var(--ink);
  --card-shadow: 4px 4px 0 var(--ink);
  --card-shadow-hover: 7px 7px 0 var(--ink);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --card-w: min(340px, calc(100vw - 3rem));
  --card-h: 200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #dff5a8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #c8e7d4 0%, transparent 50%),
    linear-gradient(160deg, #efe8d8 0%, var(--paper) 45%, #e7f0e4 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hero, main {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  padding: 3.5rem 0 1.25rem;
  animation: rise 0.8s ease both;
}

.brand {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.tagline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.lede {
  margin: 0.9rem 0 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.search {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  background: color-mix(in srgb, var(--panel) 90%, white);
  font: 500 0.95rem/1.2 var(--font-body);
  color: var(--ink);
}

.search input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, var(--ink));
  outline-offset: 1px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.digest-banner {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0.35rem auto 0;
  animation: rise 0.55s ease 0.15s both;
}

.digest-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.1rem;
  padding: 0.95rem 1.15rem;
  border: 2px solid var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #fff) 0%, var(--panel) 62%);
  box-shadow: var(--card-shadow);
}

.digest-banner-text {
  margin: 0;
  flex: 1 1 16rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.digest-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font: 600 0.95rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

/* —— Roulette / whirl —— */
.reel-section {
  padding: 0.5rem 0 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reel {
  position: relative;
  width: var(--card-w);
  height: calc(var(--card-h) * 2.35);
  margin-top: 0.5rem;
}

.reel-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 1.4rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  box-shadow: var(--shadow);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.reel-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  will-change: transform;
  transition: transform 0.9s cubic-bezier(0.33, 0.1, 0.25, 1);
}

.reel-track.spinning {
  /* Slow ease-in-out glide — one card over ~2.8s */
  transition: transform 2.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.reel-fade {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  z-index: 2;
}

.reel-fade-top {
  top: 0;
  background: linear-gradient(to bottom, var(--paper), transparent);
}

.reel-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--paper), transparent);
}

.card {
  position: relative;
  flex: 0 0 var(--card-h);
  width: calc(var(--card-w) - 1.4rem);
  height: var(--card-h);
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 0.35rem;
  box-shadow: 0 10px 28px rgba(18, 32, 24, 0.08);
  transition: transform 0.6s ease, box-shadow 0.6s ease, opacity 0.6s ease;
}

.badge-it {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
  padding: 0.18rem 0.42rem;
  border-radius: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #f4fff8;
  background: color-mix(in srgb, var(--accent) 78%, #1a3d2a);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
  pointer-events: none;
}

.card.is-center {
  background: color-mix(in srgb, var(--panel) 82%, var(--accent));
  box-shadow: 0 16px 40px rgba(18, 32, 24, 0.14);
  transform: scale(1.03);
}

.card-company {
  margin: 0;
  padding-right: 2.4rem; /* room for corner IT badge */
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-salary {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reel-hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty {
  margin: 1.5rem 0;
  color: var(--muted);
  text-align: center;
}

.results {
  padding: 0 0 3.5rem;
}

.results-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Recessed tray — cards sit inside a darker ground so white envelopes pop. */
.results-well {
  padding: 1.25rem;
  border: 1.5px solid var(--well-edge);
  border-radius: 1.25rem;
  background: var(--well);
  box-shadow: inset 0 2px 6px rgba(18, 32, 24, 0.10);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.sheet-card {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 1.5rem 1.5rem 1.5rem 2.1rem;
  overflow: hidden;
  border: var(--card-edge);
  border-radius: 0.9rem;
  background: var(--card-fill);
  box-shadow: var(--card-shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
  animation: card-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.6rem;
  background: var(--accent);
  border-right: 2px solid var(--ink);
  transition: width 0.2s ease;
}

.sheet-card .sheet-company {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(18, 32, 24, 0.66);
}

.sheet-card .sheet-title {
  margin-top: 0.4rem;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--ink);
}

.sheet-salary {
  margin: 0.65rem 0 0;
  width: fit-content;
  max-width: 100%;
  font: 800 1.15rem/1.25 var(--font-display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(transparent 58%, var(--accent) 58%);
}

.sheet-card .sheet-meta {
  margin: 0.85rem 0 0;
  gap: 0.35rem 0.4rem;
}

.sheet-card .sheet-meta li {
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(18, 32, 24, 0.16);
  border-radius: 0.35rem;
  background: var(--paper);
  font-size: 0.78rem;
  font-weight: 500;
}

.sheet-card .sheet-body {
  max-height: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  color: rgba(18, 32, 24, 0.80);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 64ch;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.sheet-card .sheet-actions {
  margin-top: auto;
  padding-top: 1.1rem;
}

.sheet-card .sheet-actions .btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sheet-card .btn.primary {
  border: 2px solid var(--ink);
  border-radius: 0.6rem;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  padding: 0.75rem 1.1rem;
}

.sheet-card .btn.primary::after {
  content: "→";
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.sheet-card .btn.primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.sheet-card .btn.primary:hover::after {
  transform: translateX(3px);
}

.sheet-card .btn.primary:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.sheet-card:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.results-grid > :nth-child(2) { animation-delay: 0.06s; }
.results-grid > :nth-child(3) { animation-delay: 0.12s; }
.results-grid > :nth-child(4) { animation-delay: 0.18s; }
.results-grid > :nth-child(5) { animation-delay: 0.22s; }
.results-grid > :nth-child(n + 6) { animation-delay: 0.26s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (hover: hover) {
  .sheet-card {
    transition:
      transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
      box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .sheet-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--card-shadow-hover);
  }

  .sheet-card:hover::before {
    width: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-card { animation: none; }
  .sheet-card,
  .sheet-card:hover { transition: none; transform: none; }
}

.sheet {
  width: min(520px, calc(100% - 1.5rem));
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sheet::backdrop {
  background: rgba(18, 32, 24, 0.45);
  backdrop-filter: blur(4px);
}

.sheet-inner {
  margin: 0;
  padding: 1.35rem 1.35rem 1.5rem;
}

.sheet-close {
  float: right;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.sheet-company {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-title {
  margin: 0.45rem 0 0;
  clear: both;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.sheet-meta {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sheet-meta li {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(18, 32, 24, 0.03);
}

.sheet-meta li.meta-it {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  color: color-mix(in srgb, var(--ink) 70%, var(--accent));
  font-weight: 600;
}

.sheet-body {
  margin: 1rem 0 0;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.95rem;
  max-height: 40vh;
  overflow: auto;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .hero { padding-top: 2.25rem; }
  .search { flex-direction: column; }
  .results-well { padding: 0.75rem; border-radius: 1rem; }
  .results-grid { gap: 1.25rem; }
}
