:root {
  color-scheme: light dark;
  --ink: #101728;
  --ink-soft: #3a4357;
  --paper: #f5f7f3;
  --paper-raised: #fcfdf9;
  --on-blue: #f5f7f3;
  --blue: #2343a6;
  --blue-deep: #142a73;
  --accent: #dff15a;
  --accent-ink: #182200;
  --line: rgba(16, 23, 40, 0.24);
  --photo-filter: saturate(0.86) contrast(1.04);
  --shadow: rgba(15, 31, 83, 0.24);
  --focus: #f0633c;
  --font: "Arial Narrow", "Aptos Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--blue);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

button:active {
  transform: translateY(1px);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 10px clamp(18px, 3vw, 48px);
  color: var(--on-blue);
  background: var(--blue);
  border-bottom: 1px solid rgba(255, 255, 255, 0.36);
}

.wordmark {
  width: max-content;
  color: inherit;
  font-size: clamp(1.55rem, 2.3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.header-note {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.saved-toggle {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 9px 8px 14px;
  color: var(--on-blue);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 0;
  font-weight: 800;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

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

.saved-count {
  display: grid;
  place-items: center;
  min-width: 25px;
  min-height: 25px;
  padding: 0 5px;
  color: var(--blue-deep);
  background: var(--paper);
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 0.74rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr);
  min-height: min(610px, calc(100dvh - 72px));
  color: var(--on-blue);
  background: var(--blue);
  overflow: hidden;
}

.hero-copy {
  align-self: center;
  padding: clamp(52px, 8vw, 110px) clamp(24px, 5.5vw, 88px);
}

.eyebrow {
  margin: 0 0 24px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(3.25rem, 6.8vw, 7.3rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

h1 i {
  display: inline-block;
  padding: 0 0 0.1em;
  color: var(--accent);
  font-weight: 900;
  line-height: 1.1;
}

.hero-intro {
  max-width: 430px;
  margin: 35px 0 0 max(0px, 14vw);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 650;
  line-height: 1.2;
}

.hero-photo {
  position: relative;
  align-self: stretch;
  margin: 0;
  clip-path: polygon(8% 0, 100% 0, 100% 93%, 82% 89%, 63% 97%, 42% 90%, 18% 96%, 0 90%, 5% 64%, 0 35%);
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(35, 67, 166, 0.04), rgba(20, 42, 115, 0.28));
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--photo-filter);
}

.browser {
  position: relative;
  min-height: 650px;
  padding: clamp(62px, 8vw, 118px) clamp(18px, 4vw, 64px) 120px;
  background-color: var(--paper);
  background-image: radial-gradient(var(--line) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}

.tool-bench {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(500px, 1.3fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: end;
  max-width: 1340px;
  margin: 0 auto 72px;
}

.browser-heading h2 {
  max-width: 560px;
  margin: 0 0 12px;
  font-size: clamp(2.5rem, 4.6vw, 5.15rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.browser-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.controls {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
  padding: 22px;
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  box-shadow: 9px 9px 0 var(--accent);
  transform: rotate(0.7deg);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
}

.field input::placeholder {
  color: #667086;
  opacity: 1;
}

.loading-grid,
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px) clamp(20px, 3vw, 48px);
  max-width: 1340px;
  margin: 0 auto;
}

.loading-grid div {
  grid-column: span 4;
  height: 420px;
  background: #dfe3df;
  clip-path: polygon(2% 1%, 96% 0, 100% 95%, 4% 100%, 0 46%);
}

@media (prefers-reduced-motion: no-preference) {
  .loading-grid div {
    animation: paper-pulse 1.2s ease-in-out infinite alternate;
  }

  .loading-grid div:nth-child(2) { animation-delay: 160ms; }
  .loading-grid div:nth-child(3) { animation-delay: 320ms; }

  @keyframes paper-pulse {
    to { opacity: 0.46; transform: translateY(5px); }
  }
}

.workshop-card {
  position: relative;
  grid-column: span 4;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 480px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  box-shadow: 6px 9px 24px var(--shadow);
  clip-path: polygon(1.5% 0.5%, 97% 0, 100% 97%, 73% 99.3%, 48% 98%, 21% 100%, 0 96%, 1% 45%);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms ease;
  opacity: 0;
  animation: land-on-table 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--order) * 70ms);
}

.workshop-card:nth-child(1),
.workshop-card:nth-child(5) {
  grid-column: span 5;
}

.workshop-card:nth-child(2),
.workshop-card:nth-child(6) {
  grid-column: span 3;
  margin-top: 70px;
}

.workshop-card:nth-child(3),
.workshop-card:nth-child(4) {
  grid-column: span 4;
}

.workshop-card:hover,
.workshop-card:focus-within {
  z-index: 2;
  box-shadow: 12px 16px 30px var(--shadow);
  transform: rotate(0deg) translateY(-8px);
}

@keyframes land-on-table {
  from { opacity: 0; transform: rotate(var(--tilt, 0deg)) translateY(28px); }
  to { opacity: 1; transform: rotate(var(--tilt, 0deg)) translateY(0); }
}

.workshop-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -10px;
  left: 50%;
  width: 76px;
  height: 25px;
  background: color-mix(in srgb, var(--accent) 78%, transparent);
  transform: translateX(-50%) rotate(-2deg);
  pointer-events: none;
}

.card-image {
  position: relative;
  min-height: 230px;
  overflow: hidden;
}

.workshop-card:nth-child(2) .card-image,
.workshop-card:nth-child(6) .card-image {
  min-height: 280px;
}

.card-image img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  filter: var(--photo-filter);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.workshop-card:nth-child(even) .card-image img {
  object-position: 65% center;
}

.workshop-card:hover .card-image img {
  transform: scale(1.035);
}

.saved-tab {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: -2px;
  padding: 7px 11px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.card-content {
  display: flex;
  flex-direction: column;
  padding: 22px 24px 27px;
}

.card-meta,
.detail-category {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-content h3 {
  margin: 0;
  font-size: clamp(1.75rem, 2.7vw, 3rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.card-practical {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin: 20px 0 23px;
  font-size: 0.92rem;
  font-weight: 700;
}

.open-item {
  width: 100%;
  margin-top: auto;
  padding: 13px 16px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease;
}

.open-item:hover {
  color: var(--accent-ink);
  background: var(--accent);
}

.empty-state,
.error-state {
  max-width: 720px;
  margin: 24px auto 0;
  padding: clamp(36px, 6vw, 72px);
  text-align: center;
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 var(--accent);
  transform: rotate(-0.6deg);
}

.empty-state h3,
.error-state h3 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.empty-state p,
.error-state p {
  margin: 0 auto 24px;
}

.empty-state .empty-kicker {
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
}

.empty-state button {
  padding: 13px 18px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent-ink);
  border-radius: 0;
  font-weight: 850;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  min-height: 220px;
  padding: 54px clamp(20px, 4vw, 64px);
  color: var(--on-blue);
  background: var(--blue-deep);
}

footer p {
  max-width: 380px;
  margin: 0;
  font-weight: 800;
}

footer p:first-child {
  color: var(--accent);
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.72;
}

.detail-dialog {
  width: min(1180px, calc(100vw - 56px));
  max-width: none;
  max-height: min(900px, calc(100dvh - 48px));
  padding: 0;
  color: var(--ink);
  background: var(--paper-raised);
  border: 0;
  border-radius: 0;
  box-shadow: 22px 28px 70px rgba(6, 12, 35, 0.46);
  overflow: auto;
}

.detail-dialog::backdrop {
  background: rgba(9, 19, 55, 0.78);
  backdrop-filter: blur(5px);
}

.detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  min-height: min(760px, calc(100dvh - 48px));
}

.detail-image {
  min-height: 100%;
}

.detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--photo-filter);
}

.detail-copy {
  display: flex;
  flex-direction: column;
  padding: clamp(38px, 5vw, 78px);
  background-color: var(--paper-raised);
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 28px;
}

.close-detail {
  align-self: end;
  min-height: 42px;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 800;
}

.detail-category {
  justify-content: flex-start;
  margin: clamp(28px, 7vh, 74px) 0 20px;
}

.detail-copy h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(3rem, 6vw, 6.8rem);
  line-height: 0.82;
  letter-spacing: -0.075em;
}

.detail-body {
  max-width: 560px;
  margin: 30px 0 36px;
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
  font-weight: 600;
  line-height: 1.42;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
  margin: 0 0 38px;
}

.detail-facts div {
  padding: 14px;
  background: color-mix(in srgb, var(--paper-raised) 88%, transparent);
  border-left: 3px solid var(--accent);
}

.detail-facts dt {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-facts dd {
  margin: 0;
  font-weight: 800;
}

.save-item {
  width: 100%;
  min-height: 56px;
  margin-top: auto;
  padding: 14px 20px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--accent-ink);
  border-radius: 0;
  box-shadow: 6px 6px 0 var(--ink);
  font-size: 1.03rem;
  font-weight: 900;
  white-space: nowrap;
}

.save-item[aria-pressed="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 var(--accent);
}

.save-notice {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  max-width: min(340px, calc(100vw - 44px));
  padding: 13px 17px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--accent-ink);
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.save-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1e9;
    --ink-soft: #bdc6d8;
    --paper: #111a31;
    --paper-raised: #182440;
    --blue: #182f86;
    --blue-deep: #0d1834;
    --accent: #dff15a;
    --accent-ink: #182200;
    --line: rgba(238, 241, 233, 0.25);
    --photo-filter: saturate(0.78) contrast(1.08) brightness(0.86);
    --shadow: rgba(2, 7, 22, 0.46);
    --focus: #ff9b7d;
  }

  .saved-count {
    color: var(--blue-deep);
    background: #eef1e9;
  }

  .loading-grid div {
    background: #263452;
  }
}

@media (max-width: 920px) {
  .tool-bench {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .workshop-card,
  .workshop-card:nth-child(n) {
    grid-column: span 6;
    margin-top: 0;
  }

  .detail-shell {
    grid-template-columns: 0.75fr 1.25fr;
  }
}

@media (max-width: 767px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding: 10px 16px;
  }

  .header-note {
    display: none;
  }

  .saved-toggle {
    min-height: 40px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    padding: 54px 18px 47px;
  }

  .eyebrow {
    margin-bottom: 19px;
  }

  h1 {
    max-width: 370px;
    font-size: clamp(3.3rem, 15vw, 5.5rem);
  }

  .hero-intro {
    max-width: 300px;
    margin: 25px 0 0 16vw;
    font-size: 1rem;
  }

  .hero-photo {
    height: 225px;
    clip-path: polygon(0 8%, 22% 3%, 49% 8%, 75% 0, 100% 6%, 100% 100%, 0 100%);
  }

  .browser {
    padding: 58px 16px 80px;
  }

  .tool-bench {
    margin-bottom: 50px;
  }

  .browser-heading h2 {
    font-size: 3.15rem;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 17px;
    box-shadow: 6px 6px 0 var(--accent);
    transform: none;
  }

  .loading-grid,
  .workshop-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .loading-grid div,
  .workshop-card,
  .workshop-card:nth-child(n) {
    grid-column: 1;
    min-height: 0;
    margin: 0;
    transform: none;
  }

  .workshop-card:hover,
  .workshop-card:focus-within {
    transform: translateY(-4px);
  }

  .card-image,
  .workshop-card:nth-child(n) .card-image {
    min-height: 225px;
    aspect-ratio: 4 / 3;
  }

  .card-content {
    min-height: 246px;
  }

  footer {
    align-items: start;
    flex-direction: column;
    min-height: 240px;
  }

  footer p:first-child {
    font-size: 4.2rem;
  }

  .detail-dialog {
    width: 100vw;
    max-height: 100dvh;
    margin: 0;
  }

  .detail-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .detail-image {
    min-height: 255px;
    max-height: 34dvh;
  }

  .detail-copy {
    min-height: 66dvh;
    padding: 20px 18px 38px;
  }

  .detail-category {
    margin: 28px 0 14px;
  }

  .detail-copy h2 {
    font-size: clamp(3rem, 14vw, 4.5rem);
  }

  .detail-body {
    margin: 21px 0 25px;
  }

  .detail-facts {
    gap: 10px;
    margin-bottom: 28px;
  }

  .detail-facts div {
    padding: 10px;
  }

  .save-item {
    white-space: normal;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .workshop-card {
    opacity: 1;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .detail-dialog::backdrop {
    background: rgba(9, 19, 55, 0.94);
    backdrop-filter: none;
  }
}
