:root {
  color-scheme: light;
  --ink: #16201f;
  --muted: #66706d;
  --paper: #f8f5ef;
  --panel: #fffdf8;
  --line: #d9d1c4;
  --amber: #d6902f;
  --amber-dark: #8d4f18;
  --teal: #1f766d;
  --plum: #6d304b;
  --charcoal: #111817;
  --shadow: 0 20px 45px rgba(23, 24, 21, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button,
a,
label.file-button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgba(14, 18, 17, 0.9) 0%, rgba(14, 18, 17, 0.68) 43%, rgba(14, 18, 17, 0.12) 100%),
    url("assets/beer-tracker-hero.png") center / cover no-repeat;
  color: #fffdf7;
}

.hero-content {
  width: min(660px, 100%);
  padding-bottom: clamp(18px, 4vh, 46px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(3.5rem, 11vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.hero-copy {
  max-width: 520px;
  margin-bottom: 24px;
  color: rgba(255, 253, 247, 0.82);
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-actions,
.card-actions,
.toolbar,
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.button.primary {
  background: var(--amber);
  color: #1b130a;
}

.button.ghost {
  border-color: rgba(255, 253, 247, 0.35);
  background: rgba(255, 253, 247, 0.12);
  color: #fffdf7;
  backdrop-filter: blur(10px);
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  background: #efe8dc;
  color: var(--ink);
  font-size: 0.88rem;
}

.button.danger {
  color: #8a1f2d;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: #efe8dc;
  color: #8a1f2d;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: -38px auto 56px;
  position: relative;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 253, 247, 0.55);
  border-radius: 8px;
  background: var(--charcoal);
  box-shadow: var(--shadow);
  color: #fffdf7;
}

.stats-strip div {
  min-height: 92px;
  padding: 20px;
  border-right: 1px solid rgba(255, 253, 247, 0.13);
}

.stats-strip div:last-child {
  border-right: 0;
}

.stats-strip span {
  display: block;
  overflow: hidden;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-strip small {
  color: rgba(255, 253, 247, 0.62);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 410px) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.entry-panel,
.log-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entry-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.log-panel {
  padding: 22px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(150px, 190px);
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #3d4744;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfc6b8;
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  outline: 0;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 108px;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 118, 109, 0.14);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--amber-dark);
}

.range-readout {
  color: var(--plum);
  font-size: 0.95rem;
  font-weight: 900;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 0.62fr;
  gap: 12px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.beer-list {
  display: grid;
  gap: 12px;
}

.beer-card {
  border: 1px solid #ddd4c7;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(214, 144, 47, 0.14), transparent 42%),
    #fffdf8;
}

.beer-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.beer-style {
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brewery,
.notes,
.meta {
  color: var(--muted);
}

.rating-pill {
  min-width: 72px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--charcoal);
  color: #fffdf7;
  font-weight: 900;
  text-align: center;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 8px;
  font-size: 0.88rem;
}

.meta div {
  display: flex;
  gap: 5px;
}

.meta dt {
  color: #4a524f;
  font-weight: 900;
}

.meta dd {
  margin: 0;
}

.notes {
  margin-bottom: 14px;
}

.empty-state {
  display: none;
  border: 1px dashed #c4b8a8;
  border-radius: 8px;
  padding: 30px;
  background: #f5efe5;
  text-align: center;
}

.empty-state.visible {
  display: block;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    min-height: 58vh;
    background:
      linear-gradient(180deg, rgba(14, 18, 17, 0.52) 0%, rgba(14, 18, 17, 0.86) 100%),
      url("assets/beer-tracker-hero.png") center / cover no-repeat;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-strip div:nth-child(2) {
    border-right: 0;
  }

  .stats-strip div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 253, 247, 0.13);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .entry-panel {
    position: static;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 66vh;
    padding: 24px 18px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  main {
    width: min(100% - 20px, 1220px);
    margin-top: -28px;
  }

  .stats-strip {
    grid-template-columns: 1fr;
  }

  .stats-strip div {
    min-height: 78px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 253, 247, 0.13);
  }

  .stats-strip div:last-child {
    border-bottom: 0;
  }

  .field-grid,
  .beer-card-main {
    grid-template-columns: 1fr;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
