:root {
  color-scheme: light;
  --ink: #17140f;
  --muted: #665f55;
  --paper: #f7f2e8;
  --panel: #fffaf0;
  --line: #d9cdbc;
  --green: #1f7a5a;
  --red: #d94c2b;
  --blue: #2458a8;
  --shadow: 0 22px 70px rgba(38, 30, 18, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  background:
    linear-gradient(90deg, rgba(23, 20, 15, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(23, 20, 15, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(23, 20, 15, 0.12);
  background: rgba(247, 242, 232, 0.88);
  backdrop-filter: blur(16px);
}

.brand,
.nav,
.hero-actions,
.card-topline,
.input-row,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
}

.nav {
  gap: 18px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

main {
  padding: 0 clamp(20px, 4vw, 56px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: center;
  min-height: calc(100svh - 72px);
  padding: 56px 0 78px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(48px, 8vw, 116px);
  line-height: 0.92;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.98;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.hero-text {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.55;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button,
.wide-button,
.input-row button {
  border: 1px solid var(--ink);
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button {
  padding: 14px 18px;
  border-radius: 999px;
}

.primary,
.input-row button,
.wide-button {
  color: #fffaf0;
  background: var(--ink);
}

.secondary {
  background: transparent;
}

.button:hover,
.wide-button:hover,
.input-row button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(23, 20, 15, 0.18);
}

.hero-panel {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(217, 76, 43, 0.18), transparent 34%),
    radial-gradient(circle at 80% 75%, rgba(36, 88, 168, 0.18), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.orbital {
  position: absolute;
  inset: 50px;
  border: 1px solid rgba(23, 20, 15, 0.16);
  border-radius: 50%;
  animation: rotate 18s linear infinite;
}

.orbital span {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
}

.orbital span:nth-child(1) {
  top: -14px;
  left: 50%;
}

.orbital span:nth-child(2) {
  right: 10%;
  bottom: 18%;
  background: var(--green);
}

.orbital span:nth-child(3) {
  bottom: 24%;
  left: 6%;
  background: var(--blue);
}

.stat-grid {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-grid div {
  padding: 20px;
  border: 1px solid rgba(23, 20, 15, 0.18);
  background: rgba(255, 250, 240, 0.82);
}

.stat-grid strong {
  display: block;
  font-size: 42px;
}

.stat-grid span,
.status,
.project-meta,
.entry-link,
.mini-tool label,
.result,
.dice-stage p,
.site-footer {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.apps,
.about {
  padding: 80px 0;
}

.section-heading,
.about {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid rgba(23, 20, 15, 0.16);
  padding-top: 28px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.app-card {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--green);
}

.app-card.accent {
  box-shadow: 8px 8px 0 var(--red);
}

.card-topline {
  justify-content: space-between;
  margin-bottom: 34px;
}

.app-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 28px;
  background: #ffffff;
}

.status {
  padding: 7px 10px;
  border: 1px solid rgba(23, 20, 15, 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13px;
}

.project-meta span {
  padding: 6px 9px;
  border: 1px solid rgba(23, 20, 15, 0.16);
  background: rgba(255, 255, 255, 0.5);
}

.app-card > p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.entry-link {
  width: fit-content;
  margin: 4px 0 28px;
  border-bottom: 2px solid currentColor;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.entry-link::after {
  content: " ->";
}

.mini-tool,
.dice-stage {
  margin-top: auto;
}

.mini-tool label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
}

.input-row {
  gap: 10px;
}

.input-row input {
  min-width: 0;
  flex: 1;
  padding: 13px 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: #fff;
}

.input-row button,
.wide-button {
  padding: 13px 16px;
  border-radius: 6px;
}

.result {
  display: block;
  min-height: 78px;
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed rgba(23, 20, 15, 0.28);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.45);
}

.dice-stage {
  display: grid;
  gap: 18px;
  min-height: 210px;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(23, 20, 15, 0.28);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.dice {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 18px;
  color: #fffaf0;
  background: var(--blue);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 48px;
  font-weight: 900;
  box-shadow: 6px 6px 0 var(--ink);
}

.dice.rolling {
  animation: tumble 450ms ease;
}

.wide-button {
  width: 100%;
  margin-top: 18px;
}

.future-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  width: min(100%, 520px);
  padding: 0;
  margin: 0;
  list-style: none;
}

.future-list li {
  padding: 14px 16px;
  border: 1px solid rgba(23, 20, 15, 0.18);
  background: rgba(255, 250, 240, 0.68);
}

.site-footer {
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(20px, 4vw, 56px);
  border-top: 1px solid rgba(23, 20, 15, 0.16);
  font-size: 14px;
}

.tool-page main {
  min-height: calc(100svh - 72px);
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: center;
  min-height: calc(100svh - 72px);
  padding: 56px 0;
}

.tool-copy h1 {
  margin-bottom: 24px;
}

.dice-playground {
  display: grid;
  min-height: min(62svh, 620px);
  place-items: center;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(217, 76, 43, 0.14), transparent 38%),
    linear-gradient(315deg, rgba(31, 122, 90, 0.16), transparent 42%),
    var(--panel);
  box-shadow: 10px 10px 0 var(--red);
  text-align: center;
}

.dice-playground p {
  max-width: 520px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.28;
}

.big-dice {
  width: clamp(140px, 20vw, 220px);
  height: clamp(140px, 20vw, 220px);
  margin-bottom: 34px;
  border-radius: 34px;
  font-size: clamp(76px, 11vw, 132px);
  box-shadow: 12px 12px 0 var(--ink);
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tumble {
  50% {
    transform: rotate(14deg) scale(1.08);
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .about,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero {
    min-height: auto;
  }

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

  .app-card {
    min-height: 460px;
  }

  .tool-hero {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .input-row,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

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