/* =========================================================
   OTGTech storefront styles
   One stylesheet for every page. Colors come from the
   brand table in the website brief (section 6).
   ========================================================= */

/* ---------- Brand colors ----------
   Stored as CSS variables so a color is changed in one place. */
:root {
  --bg: #0d141c;          /* page background */
  --card: #141e29;        /* card / panel */
  --raised: #1b2836;      /* raised panel */
  --border: #2a3a4c;
  --text: #eef3f8;        /* main text */
  --text-dim: #9fb0c2;    /* secondary text */
  --blue: #2b8cff;        /* brand blue, the "Tech" in the logo */
  --blue-light: #6fb1ff;  /* headings */
  --green: #3ddc84;       /* charging */
  --amber: #ffb547;       /* power / battery */

  --max-width: 1100px;
  --radius: 10px;
}

/* ---------- Basics ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* Makes the footer sit at the bottom even on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue-light);
}

/* Centers content and keeps a 16px gap from the screen edge on phones */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Small, uppercase, light-blue section headings (brief, section 6) */
.section-label {
  color: var(--blue-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}

/* Hidden on screen but still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header and nav ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

/* Logo: badge image + "OTGTech" wordmark */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.logo img {
  width: 44px;
  height: auto;
}

.logo .tech {
  color: var(--blue);
}

.logo sup {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-dim);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--raised);
}

/* The link for the page you're on. Set with aria-current="page" in the HTML. */
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--raised);
}

.nav-links .cart-link {
  color: var(--text);
  border: 1px solid var(--border);
}

/* The menu button only shows on phones (see the media query below) */
.menu-button {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--blue);
  color: var(--bg);   /* dark text: white on this blue is only 3.3:1, dark is 5.6:1 (WCAG AA needs 4.5:1) */
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  background: var(--blue-light);
}

/* Keyboard users can see which button has focus, on every page */
.button:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
}

.button-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}

.button-outline:hover {
  background: var(--raised);
}

/* ---------- Generic page section ---------- */
.page-section {
  padding: 40px 0;
}

.page-section h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

/* Placeholder box for pages that get built in later steps */
.coming-soon {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text-dim);
}

/* ---------- About page ----------
   The cards, the call-to-action box and the hover and keyboard styles are based on the
   About page written by sikandara09 (pull request #12), in the site's colors. */
.about-hero {
  margin-bottom: 55px;
  text-align: center;
}

.about-intro {
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.about-section {
  margin-bottom: 55px;
  text-align: center;
}

.about-section h2,
.about-cta h2 {
  margin: 0 0 15px;
  font-size: 1.9rem;
}

.about-section p {
  max-width: 750px;
  margin: 0 auto 12px;
  color: var(--text-dim);
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-top: 35px;
}

.about-card {
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.about-card:hover {
  transform: translateY(-5px);
  border-color: var(--blue);
}

.about-card h3 {
  margin: 0 0 12px;
  color: var(--blue-light);
}

.about-card p {
  margin: 0;
}

.about-cta {
  padding: 45px 20px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
}

.about-cta p {
  margin: 0 0 22px;
  color: var(--text-dim);
}

.about-cta .button:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .about-cards {
    grid-template-columns: 1fr;
  }
}

/* People who ask their device for less motion get none */
@media (prefers-reduced-motion: reduce) {
  .about-card {
    transition: none;
  }

  .about-card:hover {
    transform: none;
  }
}

/* ---------- Shop / product page ---------- */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.product-image {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.product-image img {
  max-width: 360px;
  width: 100%;
}

.product-price {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.product-blurb {
  color: var(--text-dim);
  margin: 0 0 24px;
}

/* fieldset groups related radio buttons; legend is its label */
.product-options fieldset {
  border: none;
  padding: 0;
  margin: 0 0 24px;
}

.product-options legend {
  font-weight: 700;
  margin-bottom: 10px;
}

.swatches,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Each option is a <label> wrapping a radio, so clicking anywhere on it picks it */
.swatch,
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

/* Hide the round radio dot itself; the bordered label shows the choice instead.
   opacity: 0 (not display: none) keeps it focusable with Tab and readable by screen readers. */
.swatch input,
.choice input {
  position: absolute;
  opacity: 0;
}

/* :has() styles the label when the radio inside it is checked */
.swatch:has(input:checked),
.choice:has(input:checked) {
  border-color: var(--blue);
  background: var(--raised);
}

/* Keyboard users need to see which option has focus */
.swatch:has(input:focus-visible),
.choice:has(input:focus-visible) {
  outline: 2px solid var(--blue-light);
  outline-offset: 2px;
}

/* A disabled option (like Brown when Carbon fiber is picked) looks faded and can't be clicked */
.swatch:has(input:disabled),
.choice:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}

.swatch-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
}

.field-note {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.battery-note {
  margin: 0 0 24px;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-weight: 700;
}

.quantity-row input {
  width: 80px;
  padding: 10px;
  font: inherit;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Contact page ---------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  margin-bottom: 10px;
}

/* ---------- Shared bits ---------- */
/* The hidden attribute must always win, even over rules like display: flex */
[hidden] {
  display: none !important;
}

/* ---------- Cart count in the nav ---------- */
.cart-count {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--bg);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Messages under Add to Cart buttons ---------- */
.status-message {
  margin: 12px 0 0;
  min-height: 1.4em;
  font-size: 0.95rem;
}

.status-ok {
  color: var(--green);
}

.status-error {
  color: var(--amber);
}

/* ---------- Bundles and accessories (shop page) ---------- */
.extras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.extra-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.extra-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.extra-price {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.extra-desc {
  margin: 0;
  color: var(--text-dim);
}

.extra-card .button {
  margin-top: auto;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.form-field select,
.form-field input {
  padding: 10px;
  font: inherit;
  font-weight: 400;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---------- Cart page ---------- */
.cart-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.cart-name {
  display: block;
  font-weight: 700;
}

.cart-detail {
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
  overflow-wrap: anywhere;   /* a long color note can't push the page wider */
}

.cart-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.qty-input {
  width: 72px;
  padding: 8px;
  font: inherit;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cart-line-total {
  min-width: 90px;
  font-weight: 700;
  text-align: right;
}

/* A button that looks like a link (for Remove) */
.link-button {
  padding: 0;
  background: none;
  border: none;
  color: var(--blue-light);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cart-subtotal {
  margin: 0;
  font-size: 1.2rem;
}

.cart-empty {
  color: var(--text-dim);
}

/* ---------- Deals ---------- */
/* The "Look for deals" tab under the price */
.deals-tab {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.deals-tab:hover {
  background: rgba(61, 220, 132, 0.12);
}

.deal-badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(61, 220, 132, 0.15);
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Two deal cards side by side (the phone layout below makes it one column) */
.extras-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.extra-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

/* The header is sticky, so leave room for it when jumping to the deals */
#deals {
  scroll-margin-top: 90px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Cart totals and deals ---------- */
.cart-totals {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  color: var(--text-dim);
}

.cart-deals-row {
  color: var(--green);
}

.deals-note {
  margin: 0 0 16px;
  color: var(--text-dim);
}

/* ---------- Checkout ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

.checkout-form fieldset {
  margin: 0 0 24px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.checkout-form legend {
  padding: 0 8px;
  font-weight: 700;
}

.notice {
  margin: 0 0 24px;
  padding: 14px 16px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  color: var(--text-dim);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-weight: 600;
}

.field input {
  padding: 10px;
  font: inherit;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.field input[aria-invalid="true"] {
  border-color: var(--amber);
}

.field-error {
  margin: 0;
  color: var(--amber);
  font-size: 0.9rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.order-summary {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.order-summary h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.summary-lines {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.summary-info {
  min-width: 0;
}

.summary-totals {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.summary-total {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}

.confirmation {
  max-width: 640px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.confirmation h2 {
  margin: 0 0 8px;
  color: var(--green);
}

.confirmation-number {
  font-size: 1.2rem;
}

.confirmation-number strong {
  white-space: nowrap;   /* keep OTG-XXXXXXXX on one line */
}

/* ---------- Specs page ---------- */
.specs-intro {
  max-width: 60ch;
  margin: 0;
  color: var(--text-dim);
}

.specs-section {
  margin-top: 36px;
}

.specs-section h2 {
  margin: 0 0 12px;
}

.specs-section p {
  max-width: 70ch;
}

.specs-note {
  color: var(--text-dim);
}

.estimate {
  color: var(--amber);
  font-size: 0.9em;
}

/* Every table sits in a box. On a small screen a wide table scrolls inside its box, not the page. */
.table-scroll {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th,
.specs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table tbody th {
  width: 34%;
  color: var(--text-dim);
  font-weight: 600;
}

.specs-table thead th {
  color: var(--blue-light);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layout-table {
  min-width: 560px;
}

.layout-table tbody th {
  width: auto;
}

/* The power budget bar */
.power-bar {
  display: flex;
  gap: 3px;
  height: 22px;
  margin: 4px 0 14px;
}

.power-seg {
  min-width: 6px;
  border-radius: 4px;
}

.power-phone { background: #3ddc84; }
.power-watch { background: #2fb36a; }
.power-buds  { background: #238a52; }
.power-usbc  { background: var(--blue); }

.power-legend {
  display: grid;
  gap: 6px;
  max-width: 360px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.power-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.power-legend strong {
  margin-left: auto;
}

.power-total {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.legend-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.faq dt {
  margin-top: 16px;
  font-weight: 700;
}

.faq dd {
  margin: 4px 0 0;
  max-width: 70ch;
  color: var(--text-dim);
}

/* The "swipe sideways" hint is only for phones */
.scroll-hint {
  display: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 32px 0 24px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--text);
}

/* The VE disclaimer. Required on every page by the VE rubric. */
.disclaimer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Phone layout ----------
   Everything above is the desktop layout.
   Under 760px wide, stack things and hide the nav behind a button. */
@media (max-width: 760px) {
  .menu-button {
    display: block;
  }

  .nav-links {
    display: none;            /* hidden until the menu button is tapped */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }

  /* nav.js adds the "open" class when the menu button is tapped */
  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;            /* bigger tap targets on phones */
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .product-image {
    padding: 20px;
  }
}

/* ---------- Phone layout for the shop extras and the cart ---------- */
@media (max-width: 760px) {
  .extras-grid {
    grid-template-columns: 1fr;
  }

  .cart-row {
    grid-template-columns: 1fr auto;
  }

  .cart-info {
    grid-column: 1 / -1;
  }

  .cart-summary {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .scroll-hint {
    display: block;
    margin-bottom: 0;
  }
}

/* ---------- How It Folds page ---------- */
.fold-intro {
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 0 24px;
}

.fold-video {
  margin: 0 0 32px;
}

.fold-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fold-video figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.fold-steps {
  margin: 0;
  padding-left: 1.4em;
  max-width: 65ch;
  line-height: 1.6;
}

.fold-steps li {
  margin-bottom: 10px;
}

/* ---------- Product photo (concept render) ---------- */
.product-image img.product-photo,
.product-image img[src$="portafold-hero.jpg"] {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.image-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 10px 0 0;
}


/* =========================================================
   Home page (index.html)
   Everything the home page needs is in this one block.
   Only index.html uses these classes, so they can't change other pages.
   ========================================================= */

/* Space between home sections. Every section uses the same amount so the page has an even rhythm. */
.home-section {
  padding: 72px 0 0;
}

/* Big section title that sits under a small light-blue .section-label */
.home-heading {
  margin: 0 0 28px;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* A plain link with an arrow, like "Watch the fold animation →" */
.text-link {
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link:focus-visible,
.buy-notes a:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* A bigger button for the hero and the closing section */
.button-large {
  padding: 14px 28px;
  font-size: 1.05rem;
  text-align: center;
}

/* ---------- 1. Hero ---------- */
.hero {
  padding: 64px 0 56px;
  /* A soft brand-blue glow behind the product photo */
  background: radial-gradient(ellipse at 75% 40%, rgba(43, 140, 255, 0.14), transparent 60%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.25fr;  /* the photo gets a bit more room than the text */
  gap: 48px;
  align-items: center;
}

.hero-title {
  margin: 0 0 20px;
}

/* "OTGTech PortaFold": small line above the tagline, in the logo style */
.hero-brand {
  display: block;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-brand .tech {
  color: var(--blue);
}

/* "Organize. Charge. Go.": the biggest words on the page */
.hero-tagline {
  display: block;
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

/* Each word on its own line, like a short list: Organize. / Charge. / Go. */
.hero-tagline span {
  display: block;
}

.hero-lead {
  max-width: 36ch;                   /* keep the line short enough to read */
  margin: 0 0 32px;
  color: var(--text-dim);
  font-size: 1.15rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-price {
  margin: 20px 0 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

#hero-price {
  color: var(--text);
  font-weight: 700;
}

.hero-photo {
  margin: 0;
}

/* The renders have a light background, so they sit on the dark page like a lit product photo */
.hero-photo img,
.steps-photo img {
  display: block;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.hero-photo figcaption,
.steps-photo figcaption {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- 2. Fact strip ---------- */
.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;                          /* the 1px gap shows the border color as dividers */
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact-strip li {
  padding: 20px 16px;
  background: var(--card);
  color: var(--text-dim);
  text-align: center;
}

.fact-strip strong {
  display: block;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

/* Brand colors from the brief: green means charging, amber means power and battery */
.fact-strip .fact-green {
  color: var(--green);
}

.fact-strip .fact-amber {
  color: var(--amber);
}

/* ---------- 3. Feature cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);   /* colored top edge, blue by default */
  border-radius: var(--radius);
}

.feature-green {
  border-top-color: var(--green);
}

.feature-amber {
  border-top-color: var(--amber);
}

.feature h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.feature p {
  margin: 0;
  color: var(--text-dim);
}

/* ---------- 4. How it works (three steps) ---------- */
/* A full-width band in the card color, so this section stands apart */
.home-band {
  margin-top: 72px;
  padding: 64px 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

/* The photo comes after the steps in the HTML (so phones read the steps first),
   and order: -1 moves it to the left column on bigger screens. */
.steps-photo {
  margin: 0;
  order: -1;
}

/* Numbered steps. The numbers come from a CSS counter, so the HTML stays a plain <ol>. */
.steps {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 20px 56px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--raised);
  color: var(--blue-light);
  font-weight: 800;
  line-height: 36px;
  text-align: center;
}

.steps h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  line-height: 38px;                 /* lines the title up with the number circle */
}

.steps p {
  margin: 0;
  color: var(--text-dim);
}

/* ---------- 5. Material cards ---------- */
.material-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.material-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;                  /* keeps the photo inside the rounded corners */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.material-card:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
}

.material-card:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
}

.material-card img {
  display: block;
  width: 100%;
}

.material-body {
  display: grid;
  grid-template-columns: 1fr auto;   /* name on the left, price on the right */
  gap: 4px 16px;
  padding: 20px 24px 24px;
}

.material-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.material-price {
  font-size: 1.3rem;
  font-weight: 700;
}

.material-colors {
  grid-column: 1 / -1;
  color: var(--text-dim);
}

.material-go {
  grid-column: 1 / -1;
  margin-top: 12px;
  color: var(--blue-light);
  font-weight: 700;
}

.material-card:hover .material-go {
  text-decoration: underline;
}

/* The short list under the cards: battery, cable, bundle */
.buy-notes {
  margin: 20px 0 0;
  padding: 0 0 0 1.2em;
  color: var(--text-dim);
}

.buy-notes li {
  margin-bottom: 4px;
}

/* ---------- 6. Closing call to action ---------- */
.home-cta {
  padding: 56px 24px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.home-cta .home-heading {
  margin-bottom: 12px;
}

.home-cta-text {
  max-width: 48ch;
  margin: 0 auto 28px;
  color: var(--text-dim);
}

.home-cta-buttons {
  justify-content: center;
}

/* People who ask their device for less motion: no lifting cards */
@media (prefers-reduced-motion: reduce) {
  .material-card {
    transition: none;
  }

  .material-card:hover {
    transform: none;
  }
}

/* ---------- Home page on tablets ---------- */
@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-tagline {
    font-size: 3rem;
  }
}

/* ---------- Home page on phones ---------- */
@media (max-width: 760px) {
  .home-section {
    padding-top: 48px;
  }

  .home-heading {
    margin-bottom: 20px;
    font-size: 1.65rem;
  }

  .hero {
    padding: 32px 0 40px;
  }

  /* One column: words first, then the photo */
  .hero-inner,
  .steps-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-tagline {
    font-size: 2.5rem;
  }

  .steps-photo {
    order: 0;                        /* back under the steps */
  }

  .hero-lead {
    margin-bottom: 24px;
    font-size: 1.05rem;
  }

  /* Full-width buttons are easier to tap */
  .hero-buttons .button {
    flex: 1 1 100%;
  }

  .fact-strip {
    grid-template-columns: 1fr 1fr;  /* 2 x 2 on phones */
  }

  .fact-strip strong {
    font-size: 1.5rem;
  }

  .feature-grid,
  .material-grid {
    grid-template-columns: 1fr;
  }

  .home-band {
    margin-top: 48px;
    padding: 48px 0;
  }

  .home-cta {
    padding: 40px 20px;
  }
}
