:root {
  color-scheme: light;
  --ink: #16201b;
  --muted: #60706a;
  --line: #dfe7e3;
  --panel: #ffffff;
  --soft: #f5f8f6;
  --green: #00b67a;
  --deep: #073b2a;
  --gold: #f3b340;
  --blue: #2764ad;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(16px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: white;
  background: var(--green);
}

.search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 180px) auto;
  gap: 10px;
  width: 100%;
}

input,
select,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

button {
  padding: 0 18px;
  border-color: var(--green);
  background: var(--green);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  padding: clamp(44px, 8vw, 92px) 0 28px;
}

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

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.6;
}

.rating-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(15, 35, 26, 0.08);
}

.score {
  font-size: 4rem;
  line-height: 1;
  font-weight: 850;
}

.stars {
  margin: 10px 0;
  color: var(--green);
  letter-spacing: 2px;
  font-size: 1.35rem;
}

.rating-panel p,
footer span {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.controls span,
.sort-wrap label {
  color: var(--muted);
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  padding: 24px 0 56px;
}

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

.add-review-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(15, 35, 26, 0.08);
}

.add-review-panel h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}

.add-review-panel p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.add-review-panel form {
  display: grid;
  gap: 10px;
}

.add-review-panel label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  background: white;
  resize: vertical;
}

.add-review-panel small {
  min-height: 18px;
  color: var(--green);
  font-weight: 800;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 282px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.card:hover,
.card:focus {
  outline: none;
  transform: translateY(-2px);
  border-color: #b9cec5;
  box-shadow: 0 12px 30px rgba(15, 35, 26, 0.08);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rating {
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.mini-stars { color: var(--green); }

.review {
  margin: 0 0 14px;
  color: #384740;
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--deep);
  font-size: 0.78rem;
  font-weight: 700;
}

footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 28px 16px 42px;
  border-top: 1px solid var(--line);
  background: white;
}

.profile-open {
  overflow: hidden;
}

.profile-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 20, 16, 0.48);
}

.profile-shell[hidden] {
  display: none;
}

.profile {
  position: relative;
  width: min(980px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: white;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

.profile-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--line);
  background: white;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
}

.profile-hero h2 {
  margin: 0;
  padding-right: 42px;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1;
}

.profile-meta {
  margin-top: 12px;
  color: var(--muted);
}

.profile-score {
  min-width: 130px;
  align-self: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.profile-score strong {
  display: block;
  font-size: 2.2rem;
}

.profile-score span {
  color: var(--green);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  padding: 28px 34px 34px;
}

.profile h3 {
  margin: 0 0 12px;
}

.profile-main > p {
  margin: 0 0 24px;
  color: #384740;
  line-height: 1.6;
}

.full-review {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.full-review div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.full-review span {
  color: var(--green);
}

.full-review p {
  margin: 10px 0;
  line-height: 1.6;
}

.full-review small,
.profile-side dt {
  color: var(--muted);
}

.profile-side {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.profile-side dl {
  margin: 0;
}

.profile-side dt {
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-side dd {
  margin: 4px 0 0;
  line-height: 1.4;
}

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

.lorp-highlights {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 24px;
  align-items: center;
  margin: 0 auto 28px;
  padding: 30px;
  width: min(1180px, calc(100% - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.highlight-copy h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.03;
}

.highlight-copy p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.highlight-grid,
.lorp-profile-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.highlight-grid article,
.lorp-profile-highlights article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.highlight-grid strong,
.lorp-profile-highlights strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.highlight-grid span,
.lorp-profile-highlights span {
  color: var(--muted);
  line-height: 1.45;
}

.lorp-profile-highlights {
  margin: 0 0 24px;
}

@media (max-width: 900px) {
  .topbar,
  .hero,
  .controls,
  footer { align-items: stretch; }

  .topbar,
  .hero,
  .lorp-highlights {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .search,
  .directory-layout,
  .grid,
  .profile-grid,
  .highlight-grid,
  .lorp-profile-highlights {
    grid-template-columns: 1fr;
  }

  .add-review-panel {
    position: static;
    order: -1;
  }

  .profile-hero {
    flex-direction: column;
  }

  .controls,
  footer {
    flex-direction: column;
  }
}
