/* ── Design tokens ───────────────────────────────────────── */
:root {
  --brand-color: #0f1a3a;
  --video-size: clamp(240px, 38vw, 420px);
  --title-gap: 10px;
  --title-row-gap: 40px;
}

/* ── Reset-ish ───────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  color: #111827;
  background-color: #ffffff;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; }

/* ── Layout helpers ──────────────────────────────────────── */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding-top: 40px;
  padding-bottom: 56px;
}

.container .title {
  line-height: .85;
  margin: 0;
  font-weight: 700;
}

/* ── Title + square video layout ─────────────────────────── */
.title { 
  font-size: clamp(24px, 6vw, 48px); /* responsive baseline */
  line-height: 1.05;
  margin: 0;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-wrap: balance; /* optional: experimental */
}

.title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;       
  column-gap: var(--title-gap);
  row-gap: var(--title-row-gap);
  margin-bottom: 32px;
  padding-inline: clamp(12px, 4vw, 32px);
  container-type: inline-size;
}

.title-row .title {
  flex: 1 1 0;
  min-width: 0;
}

.title-row h1 {
  margin: 0;
  letter-spacing: -0.5px;
  text-wrap: balance;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.title-video {
  flex: 0 0 var(--video-size);
  max-width: var(--video-size);
  width: 100%;
}

.square-video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;           
  object-fit: cover;            
  border-radius: 12px;
}

/* ── Responsive rules ────────────────────────────────────── */

/* extra-small phones: keep compact where needed */
@media (max-width: 360px) {
  .title {
    font-size: clamp(24px, 9vw, 48px); /* your existing tiny-phone rule */
  }
  .title-row { padding-inline: 12px; }
}

/* phones / narrow devices when the layout stacks (361px → 599px)
   — make the title at least twice the small baseline */
@media (min-width: 361px) and (max-width: 599px) {
  .title-row {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .title-video { flex-basis: 100%; max-width: 100%; }

  .title {
    /* min is 64px (≈2× a 32px baseline), scales, caps so it won't explode */
    font-size: clamp(64px, 12vw, 144px);
    line-height: 1.02;
    transition: font-size 160ms ease;
  }
}

/* tablet landscape and small laptops (600px → 1023px) */
@media (min-width: 600px) and (max-width: 1023px) {
  .title {
    font-size: clamp(40px, 8vw, 100px); /* tablet-friendly */
  }
  .title-row { /* optional: loosen padding on larger devices */
    padding-inline: clamp(16px, 4vw, 32px);
  }
}

/* desktop / large screens */
@media (min-width: 1024px) {
  .title {
    font-size: clamp(56px, 10vw, 140px);
  }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  color: #000000;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 12px;
}

.hero .lead { color: #4b5563; }

/* ── Card grid (default) ─────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

/* ── PRODUCTS: always two-up ─────────────────────────────── */
.grid.grid--products {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
}

.card {
  display: block;                  /* anchors fill the card area */
  text-decoration: none;           /* remove link underline */
  color: inherit;                  /* inherit text color */

  border: 1px solid #f8f8f8;
  border-radius: 14px;
  padding: 14px;

  transition: transform 120ms ease, box-shadow 120ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
}
.card:focus-visible {
  outline: 3px solid #111827;      /* keyboard focus */
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.card h4 {
  margin-top: 8px;
  margin-bottom: 4px;
  color: #2c2c2c;
  font-size: 16px;
}

.card p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

/* ── Spinbox (image drag area) ───────────────────────────── */
.spinbox-wrap {
  border-radius: 12px;
  padding: 4px;
  background: linear-gradient(180deg, #eeeeee, #ffffff00);
}

.spinbox {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: pan-y;
  cursor: grab;
}

.spinbox:active { cursor: grabbing; }
