:root {
  --ink: oklch(15% 0.018 74);
  --muted: oklch(49% 0.024 72);
  --paper: oklch(96.5% 0.012 82);
  --panel: oklch(99% 0.007 82);
  --panel-deep: oklch(91% 0.023 78);
  --line: oklch(79% 0.021 76);
  --accent: oklch(43% 0.128 35);
  --accent-dark: oklch(31% 0.108 34);
  --accent-soft: oklch(89% 0.052 41);
  --success: oklch(47% 0.105 151);
  --error: oklch(48% 0.138 28);
  --shadow: 0 30px 80px oklch(26% 0.025 70 / 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Geist, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, oklch(79% 0.09 43 / 0.34), transparent 24rem),
    radial-gradient(circle at 8% 18%, oklch(82% 0.04 196 / 0.22), transparent 25rem),
    linear-gradient(180deg, oklch(94% 0.017 79), var(--paper) 42rem);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.nav {
  position: fixed;
  z-index: 20;
  top: 22px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid oklch(100% 0 0 / 0.56);
  border-radius: 999px;
  background: oklch(98% 0.009 80 / 0.84);
  box-shadow: 0 14px 48px oklch(22% 0.028 70 / 0.11);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.hero-actions,
.output-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.nav-links a {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(2rem, 5vw, 5rem);
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 168px 0 110px;
}

.hero-copy {
  max-width: min(1120px, 100%);
  padding-top: 34px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: min(1120px, 100%);
  margin-bottom: 26px;
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.1rem;
}

.hero p {
  max-width: 68ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  border-color: var(--accent);
  color: oklch(98% 0.006 78);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.button.secondary {
  color: var(--ink);
  background: oklch(99% 0.006 82);
}

.hero-art {
  position: relative;
  min-height: 520px;
}

.art-frame {
  height: 100%;
  overflow: hidden;
  border: 1px solid oklch(100% 0 0 / 0.62);
  border-radius: 36px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.art-frame img,
.accordion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.58) contrast(1.24) saturate(0.82);
  transition: transform 700ms ease, opacity 700ms ease;
}

.art-frame:hover img,
.accordion article:hover img {
  transform: scale(1.05);
}

.floating-proof {
  position: absolute;
  right: -16px;
  bottom: 46px;
  width: min(280px, 72%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: oklch(99% 0.009 82 / 0.9);
  box-shadow: var(--shadow);
}

.floating-proof span {
  display: block;
  color: var(--accent);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.floating-proof strong {
  display: block;
  margin-top: 10px;
  line-height: 1.25;
}

.marquee {
  width: 100%;
  overflow: hidden;
  padding: 24px 0;
  border-block: 1px solid var(--line);
  background: var(--ink);
  color: oklch(96% 0.01 82);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 36px;
  animation: marquee 28s linear infinite;
}

.marquee span {
  font-size: clamp(1.3rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.workbench {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 18px;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(6rem, 12vw, 12rem) 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(99% 0.008 82 / 0.86);
  box-shadow: var(--shadow);
}

.matrix-panel {
  grid-column: span 8;
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.run-panel {
  grid-column: span 4;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: clamp(1.25rem, 3vw, 2rem);
  position: sticky;
  top: 110px;
}

.output-panel {
  grid-column: span 12;
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.panel-heading,
.output-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.inline-media {
  flex: 0 0 auto;
  width: 140px;
  height: 58px;
  border-radius: 999px;
  background: url("https://picsum.photos/seed/simplex-pages/500/220") center / cover;
  filter: grayscale(0.35) contrast(1.18);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

label.wide {
  grid-column: span 3;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: oklch(98% 0.007 82);
}

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

.advanced {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-deep);
}

.advanced summary {
  cursor: pointer;
  font-weight: 800;
}

.advanced .control-grid {
  margin-top: 16px;
}

.table-block {
  margin-top: 28px;
}

.matrix-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  min-width: 86px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--panel-deep);
  font-size: 0.82rem;
}

td input {
  min-height: 38px;
  padding: 0 10px;
  text-align: right;
}

.check-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.status-line {
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel-deep);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.metrics div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-deep);
}

.metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics strong {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.solution-table {
  margin-bottom: 22px;
  color: var(--muted);
}

.latex-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: oklch(20% 0.019 73);
  color: oklch(96% 0.008 82);
}

.latex-preview summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
}

.desire {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 6rem);
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(6rem, 13vw, 13rem) 0;
}

.pin-title {
  align-self: start;
}

.reveal-text {
  max-width: 74ch;
  color: var(--muted);
  font-size: clamp(1.35rem, 2.6vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.accordion {
  display: flex;
  gap: 12px;
  height: 520px;
  margin-top: 48px;
}

.accordion article {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  transition: flex 700ms ease;
}

.accordion article:hover {
  flex: 2.6;
}

.accordion h3 {
  position: absolute;
  left: 20px;
  bottom: 18px;
  margin: 0;
  color: oklch(98% 0.006 82);
  font-size: 1.6rem;
  text-shadow: 0 2px 18px oklch(10% 0.02 70 / 0.8);
}

.footer {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto 32px;
  padding: clamp(3rem, 7vw, 6rem);
  border-radius: 34px;
  color: oklch(97% 0.007 82);
  background: radial-gradient(circle at 90% 10%, oklch(55% 0.15 36), transparent 26rem), var(--ink);
}

.footer h2 {
  max-width: 900px;
}

@media (max-width: 920px) {
  .nav-links {
    display: none;
  }

  .hero,
  .desire {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 360px;
  }

  .matrix-panel,
  .run-panel,
  .output-panel {
    grid-column: span 12;
  }

  .run-panel {
    position: static;
  }

  .control-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  label.wide {
    grid-column: auto;
  }

  .panel-heading,
  .output-title,
  .output-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .accordion {
    height: 380px;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 126px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .floating-proof {
    right: 12px;
    bottom: 18px;
  }
}

/* Dashboard reset: keep the app focused on data entry, solving, and export. */
body {
  min-height: 100vh;
  overflow: hidden;
  background: oklch(96.5% 0.009 82);
}

.hero,
.marquee,
.desire,
.footer,
.inline-media {
  display: none !important;
}

.page {
  height: 100vh;
  padding: 12px;
  overflow: hidden;
}

.nav {
  position: static;
  width: 100%;
  height: 112px;
  max-width: none;
  padding: 10px 16px;
  border-radius: 14px;
  background: oklch(99% 0.006 82);
  box-shadow: none;
  transform: none;
}

.brand img {
  width: 150px;
  height: 96px;
  object-fit: contain;
}

.brand span {
  font-size: 1.35rem;
}

.logo-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: oklch(15% 0.018 74 / 0.55);
}

.logo-modal[hidden] {
  display: none;
}

.logo-dialog {
  position: relative;
  width: min(520px, 92vw);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: oklch(99% 0.006 82);
  box-shadow: 0 30px 80px oklch(15% 0.018 74 / 0.28);
}

.logo-dialog img {
  display: block;
  width: 100%;
  height: auto;
}

.logo-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: oklch(96% 0.007 82);
  font-size: 1.35rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 10px;
}

.workbench {
  width: 100%;
  height: calc(100vh - 136px);
  max-width: none;
  grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
  grid-template-rows: 232px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0 0;
  overflow: hidden;
}

.panel {
  border-radius: 14px;
  box-shadow: none;
  background: oklch(99% 0.006 82);
}

.matrix-panel {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.run-panel {
  grid-column: 2;
  grid-row: 1;
  position: static;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.output-panel {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.panel-heading,
.output-title {
  align-items: center;
  margin-bottom: 12px;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 0.72rem;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.control-grid {
  grid-template-columns: 1.25fr 0.55fr 0.55fr;
  gap: 10px;
}

label {
  gap: 5px;
  font-size: 0.8rem;
}

input,
select {
  min-height: 38px;
  border-radius: 8px;
}

.advanced {
  margin: 10px 0;
  padding: 10px;
  border-radius: 10px;
}

.advanced .control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.table-block {
  margin-top: 14px;
}

.matrix-table {
  max-width: 100%;
  border-radius: 10px;
}

th,
td {
  min-width: 78px;
  padding: 7px;
}

td input {
  min-height: 32px;
}

.button {
  min-height: 42px;
  border-radius: 10px;
}

.run-panel > p:not(.eyebrow):not(.status-line) {
  margin-bottom: 4px;
  color: var(--muted);
}

.status-line {
  min-height: auto;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
}

.metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metrics div {
  padding: 10px;
  border-radius: 10px;
}

.metrics span {
  font-size: 0.7rem;
}

.metrics strong {
  font-size: 1rem;
}

.solution-wrap {
  margin-top: 10px;
}

.solution-table {
  margin-bottom: 8px;
  overflow: auto;
}

.output-actions {
  gap: 8px;
}

.output-actions .button {
  min-width: 150px;
}

.download-row {
  display: flex;
  gap: 8px;
}

.pdf-preview {
  height: 220px;
  min-height: 180px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(94% 0.006 82);
}

.pdf-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.empty-preview {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.latex-preview {
  display: none;
  margin-top: 8px;
}

.latex-preview[open] {
  display: block;
}

.latex-preview pre,
pre {
  max-height: 210px;
  padding: 12px;
}

@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .nav {
    position: sticky;
    top: 12px;
    z-index: 30;
    height: auto;
    gap: 12px;
  }

  .nav-links {
    flex: 1 1 320px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-links .button {
    width: 100%;
  }

  .workbench {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow: visible;
  }

  .matrix-panel,
  .run-panel,
  .output-panel {
    grid-column: 1;
    grid-row: auto;
    overflow: visible;
  }

  #workbench,
  #output {
    scroll-margin-top: 160px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 10px;
  }

  .nav {
    top: 10px;
    align-items: stretch;
    padding: 12px;
    border-radius: 18px;
  }

  .brand {
    width: 100%;
  }

  .brand img {
    width: 96px;
    height: 62px;
  }

  .brand span {
    font-size: 1.08rem;
  }

  .nav-links {
    width: 100%;
    flex-basis: 100%;
  }

  .workbench {
    gap: 10px;
    padding-top: 10px;
  }

  .matrix-panel,
  .run-panel,
  .output-panel {
    padding: 14px;
  }
}
