:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef6f2;
  --text: #17201d;
  --muted: #5c6764;
  --line: #d9e1dc;
  --primary: #24735a;
  --primary-strong: #174d3d;
  --accent: #d35f45;
  --sky: #376f9f;
  --gold: #d79726;
  --shadow: 0 16px 48px rgb(23 32 29 / 10%);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101514;
  --surface: #19211f;
  --surface-soft: #20352e;
  --text: #edf4ef;
  --muted: #aebbb6;
  --line: #31433c;
  --primary: #7bd6ad;
  --primary-strong: #a8efcc;
  --accent: #ff987d;
  --sky: #8ec4f0;
  --gold: #f0bd58;
  --shadow: 0 16px 48px rgb(0 0 0 / 28%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101514;
    --surface: #19211f;
    --surface-soft: #20352e;
    --text: #edf4ef;
    --muted: #aebbb6;
    --line: #31433c;
    --primary: #7bd6ad;
    --primary-strong: #a8efcc;
    --accent: #ff987d;
    --sky: #8ec4f0;
    --gold: #f0bd58;
    --shadow: 0 16px 48px rgb(0 0 0 / 28%);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgb(36 115 90 / 10%) 0 25rem, transparent 25rem),
    var(--bg);
}

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

button,
input,
select {
  color: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  transform: translateY(-150%);
}

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

.app-shell {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.topbar,
.nav,
.hero,
.work-area,
.section-heading,
.input-row,
.thing-row,
.settings-grid,
.site-footer {
  display: flex;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 0.8rem 0;
  background: color-mix(in srgb, var(--bg), transparent 6%);
  backdrop-filter: blur(18px);
}

.topbar h1,
.hero h2,
.panel h2,
.side-panel h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 12%);
}

.nav a {
  min-width: 5.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

main {
  display: grid;
  gap: 1rem;
}

.hero {
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(1rem, 4vw, 3rem);
  min-height: 390px;
  padding: clamp(1.25rem, 5vw, 4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(55 111 159 / 16%), transparent 48%),
    linear-gradient(315deg, rgb(215 151 38 / 18%), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  align-self: center;
  max-width: 700px;
}

.hero h2 {
  max-width: 11ch;
  font-size: clamp(2.65rem, 8vw, 6.1rem);
}

.hero p:not(.eyebrow) {
  max-width: 48ch;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.prompt-panel,
.panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.prompt-panel {
  display: grid;
  align-self: flex-end;
  gap: 0.9rem;
  width: min(100%, 320px);
  padding: 1rem;
}

.prompt-panel span {
  color: var(--sky);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.prompt-panel p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--primary-strong);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: var(--primary);
}

.work-area {
  align-items: flex-start;
  gap: 1rem;
}

.journal-panel {
  flex: 1 1 700px;
}

.panel,
.side-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.section-heading {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel h2,
.side-panel h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.thing-form {
  display: grid;
  gap: 0.45rem;
}

.thing-form label,
.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.input-row {
  gap: 0.6rem;
}

.input-row select {
  max-width: 9rem;
}

input,
select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 35%);
  padding: 0.65rem 0.75rem;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 62%);
  outline-offset: 2px;
}

.thing-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.empty-state {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.thing-row {
  align-items: center;
  gap: 0.7rem;
  min-height: 4rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 24%);
}

.thing-content {
  display: grid;
  flex: 1;
  gap: 0.18rem;
  min-width: 0;
}

.thing-kind,
.thing-content time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.thing-text {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.icon-button {
  flex: 0 0 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

.side-panel {
  flex: 0 1 320px;
}

.metric-grid {
  display: grid;
  grid: auto / repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.metric-grid div {
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.metric-grid strong {
  color: var(--primary);
  font-size: 3rem;
  line-height: 0.9;
}

.metric-grid span {
  color: var(--muted);
  font-weight: 800;
}

.settings-panel {
  margin-bottom: 1rem;
}

.settings-grid {
  gap: 1rem;
}

.field {
  display: grid;
  flex: 1;
  gap: 0.45rem;
}

.save-state {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.site-footer {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-footer a {
  color: var(--primary);
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .work-area,
  .settings-grid,
  .input-row {
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
    position: static;
  }

  .nav {
    overflow-x: auto;
  }

  .nav a {
    flex: 1;
  }

  .hero h2 {
    max-width: 10ch;
  }

  .prompt-panel,
  .side-panel,
  .input-row select {
    width: 100%;
    max-width: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
