/*
  rent.w9w6.com: Rental Manager. Same system as the hub; the product's line colour
  (green) leads. The memorable thing is the workbook preview: real sheet names,
  real sample rows, tabs that switch with no script (radio inputs + ~ selectors).
*/

:root {
  --cell-head: #e9eeec;
  --bar: #0f5e3c;
  --st-active-bg: #dcf2e6;
  --st-active-fg: #0d5a39;
  --st-soon-bg: var(--warn-bg);
  --st-soon-fg: var(--warn);
  --st-expired-bg: #e6eaec;
  --st-expired-fg: #46535f;
  --st-upcoming-bg: #e2e8ff;
  --st-upcoming-fg: #2443b5;
  --st-cancelled-bg: #fbe3df;
  --st-cancelled-fg: #96281b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cell-head: #182635;
    --bar: #0f5e3c;
    --st-active-bg: #12382a;
    --st-active-fg: #7fe0b0;
    --st-expired-bg: #1f2c39;
    --st-expired-fg: #b4c0c9;
    --st-upcoming-bg: #1c2650;
    --st-upcoming-fg: #aebcff;
    --st-cancelled-bg: #3d1d19;
    --st-cancelled-fg: #ffaa9c;
  }
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
}
.hero h1 {
  font-size: var(--step-5);
  color: var(--ink);
}
.hero h1::after {
  content: "";
  display: block;
  inline-size: 4.5rem;
  block-size: 0.5rem;
  margin-block-start: 1.1rem;
  border-radius: 0.5rem;
  background: var(--line-rent);
}
.lead {
  max-inline-size: 34rem;
  margin-block: 1.5rem 2rem;
  color: var(--ink-2);
  font-size: var(--step-1);
}

.buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.btn:disabled {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px dashed var(--ink-2);
  cursor: not-allowed;
}
.buy-note {
  margin-block-start: 0.85rem;
  color: var(--ink-2);
  font-size: var(--step--1);
}

.facts {
  margin: 0;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.facts > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding-block: 0.7rem;
}
.facts > div + div {
  border-block-start: 1px solid var(--rule);
}
.facts dt {
  color: var(--ink-2);
  font-size: var(--step--1);
  padding-block-start: 0.1rem;
}
.facts dd {
  margin: 0;
  font-weight: 600;
}

@media (max-width: 47.99rem) {
  .hero {
    grid-template-columns: 1fr;
  }
}

/* ---------- the workbook preview ---------- */

.preview {
  padding-block-end: clamp(1rem, 3vw, 2rem);
}

.book {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--surface);
  font-family: var(--font-body);
}

.tab-input {
  position: absolute;
  opacity: 0;
  inline-size: 1px;
  block-size: 1px;
  pointer-events: none;
}

.book-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  background: var(--bar);
  color: #ffffff;
  font-size: var(--step--1);
}
.file {
  font-weight: 600;
}
.cell-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cell-lang b {
  padding: 0 0.55rem;
  border-radius: 0.3rem;
  background: #ffffff;
  color: var(--bar);
}

.fx {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-block-end: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
}
.fx-label {
  font-weight: 600;
  color: var(--ink);
}
.fx code {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.sheet {
  display: none;
}
#tab-sum:checked ~ .sheets .sheet-sum,
#tab-con:checked ~ .sheets .sheet-con,
#tab-arr:checked ~ .sheets .sheet-arr {
  display: block;
}

.scroll {
  overflow-x: auto;
}
.scroll:focus-visible {
  outline-offset: -3px;
}

.book table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}
.book th,
.book td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  text-align: start;
  white-space: nowrap;
}
.book thead th {
  background: var(--cell-head);
  font-weight: 600;
}
.book tr > :first-child {
  border-inline-start: 0;
}
.book tr > :last-child {
  border-inline-end: 0;
}
.book thead tr > * {
  border-block-start: 0;
}
.book .rn {
  inline-size: 2.75rem;
  background: var(--cell-head);
  color: var(--ink-2);
  text-align: center;
}
.book .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.book tfoot th {
  text-align: start;
  font-weight: 600;
}
.book tfoot td.num {
  font-weight: 700;
}

.st {
  display: inline-block;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.st-active {
  background: var(--st-active-bg);
  color: var(--st-active-fg);
}
.st-soon {
  background: var(--st-soon-bg);
  color: var(--st-soon-fg);
}
.st-expired {
  background: var(--st-expired-bg);
  color: var(--st-expired-fg);
}
.st-upcoming {
  background: var(--st-upcoming-bg);
  color: var(--st-upcoming-fg);
}
.st-cancelled {
  background: var(--st-cancelled-bg);
  color: var(--st-cancelled-fg);
  text-decoration: line-through;
}
.wa {
  color: var(--line-rent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.none {
  color: var(--ink-2);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 1px;
  background: var(--rule);
  border-block-end: 1px solid var(--rule);
}
.kpi-head {
  grid-column: 1 / -1;
  padding: 0.5rem 1rem;
  background: var(--cell-head);
  font-weight: 600;
  font-size: 0.875rem;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
}
.kpi span {
  color: var(--ink-2);
  font-size: 0.8125rem;
}
.kpi b {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.2;
}

.tabs {
  display: flex;
  overflow-x: auto;
  border-block-start: 1px solid var(--rule);
  background: var(--cell-head);
}
.tabs label {
  flex: none;
  padding: 0.7rem 1.1rem;
  border-inline-end: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}
.tabs label:hover {
  color: var(--ink);
}
#tab-sum:checked ~ .tabs [for="tab-sum"],
#tab-con:checked ~ .tabs [for="tab-con"],
#tab-arr:checked ~ .tabs [for="tab-arr"] {
  background: var(--surface);
  color: var(--line-rent);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--line-rent);
}
#tab-sum:focus-visible ~ .tabs [for="tab-sum"],
#tab-con:focus-visible ~ .tabs [for="tab-con"],
#tab-arr:focus-visible ~ .tabs [for="tab-arr"] {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
}

.book figcaption {
  padding: 0.85rem 1rem;
  border-block-start: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: var(--step--1);
}

/* ---------- what it does ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li {
  padding-block: 1.4rem 1.6rem;
  border-block-start: 1px solid var(--rule);
}
.features h3 {
  font-size: var(--step-2);
  margin-block-end: 0.5rem;
}
.features p {
  color: var(--ink-2);
  max-inline-size: 40ch;
}
.features .where {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-start: 0.75rem;
  color: var(--line-rent);
  font-size: var(--step--1);
  font-weight: 600;
}
.features .where::before {
  content: "";
  inline-size: 0.9rem;
  block-size: 0.6rem;
  border-radius: 0.2rem 0.2rem 0 0;
  border: 1.5px solid currentColor;
  border-block-end-width: 3px;
}

/* ---------- inside the file ---------- */

.inside {
  background: var(--surface);
  border-block: 1px solid var(--rule);
}
.sheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sheet-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-block-end: 3px solid var(--line-rent);
  border-radius: 0.6rem 0.6rem 0 0;
  background: var(--ground);
}
.sheet-list b {
  font-family: var(--font-display);
  font-weight: 600;
}
.sheet-list span {
  color: var(--ink-2);
  font-size: var(--step--1);
}

/* ---------- before you buy ---------- */

.terms {
  margin: 0;
  max-inline-size: 52rem;
}
.terms > div {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
  border-block-start: 1px solid var(--rule);
}
.terms dt {
  font-weight: 600;
}
.terms dd {
  margin: 0;
  color: var(--ink-2);
}
@media (max-width: 34rem) {
  .terms > div {
    grid-template-columns: 1fr;
  }
}

/* ---------- closing ---------- */

.closing h2 {
  font-size: var(--step-4);
  margin-block-end: 1rem;
}
.closing p {
  max-inline-size: 38rem;
  color: var(--ink-2);
  font-size: var(--step-1);
}
.closing p + p {
  margin-block-start: 1.25rem;
}
.closing a {
  font-weight: 600;
}

/* ---------- motion ----------
   One moment on load: the workbook rises into place. Switching a sheet fades
   the new one in, which answers the click rather than decorating the page. */

@media (prefers-reduced-motion: no-preference) {
  .book {
    animation: rise 0.8s var(--ease-out) 0.15s both;
  }
  .sheet {
    animation: fade 0.25s ease both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
