/*
 * Studio Hana — homepage.
 * Built against the approved homepage mockup. Palette, radii and card treatment follow
 * the supplied starter styles; everything structural is CSS so the PNGs stay flat artwork.
 */

/* ── Shared ──────────────────────────────────────────────────────────────────── */

.section {
  max-width: var(--hana-max);
  margin-inline: auto;
  padding: var(--hana-section) var(--hana-gutter);
}

.section--flush {
  padding-block-end: calc(var(--hana-section) * 0.6);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  background: var(--hana-ink);
  color: var(--hana-page);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--hana-olive);
  outline-offset: 3px;
  border-radius: 4px;
}

.eyebrow {
  display: block;
  font-size: var(--hana-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hana-ink-soft);
}

/* Arrows nudge on hover — the one piece of interaction the mockup's circular and inline
   arrows imply. */
.link-arrow,
.pill-arrow {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-enter);
}

.text-link:hover .link-arrow,
.pill-button:hover .pill-arrow {
  transform: translateX(4px);
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px calc(var(--hana-gutter) + 14px);
  padding-top: calc(22px + env(safe-area-inset-top, 0px));
  /* Starts over the hero artwork in white. */
  color: #fffefa;
  transition:
    background var(--dur-base) var(--ease-enter),
    color var(--dur-base) var(--ease-enter),
    border-color var(--dur-base) var(--ease-enter);
  border-bottom: 1px solid transparent;
}

.site-header.is-solid {
  background: color-mix(in srgb, var(--hana-page) 90%, transparent);
  backdrop-filter: blur(14px);
  color: var(--hana-ink);
  border-bottom-color: var(--hana-line-soft);
}

/*
 * Brand lockup — the supplied logo artwork (References/logo studio H.png), traced and
 * re-laid out horizontally by tools/assemble-logo.mjs. Fills are CSS custom properties,
 * which inherit through the <use> boundary: olive badge and black type on solid
 * surfaces, all white over the hero.
 */
.brand {
  display: block;
  color: inherit;
  text-decoration: none;
  --logo-mark: #565a2e;
  --logo-word: #0b0b0b;
}

.brand__lockup {
  display: block;
  width: clamp(190px, 19vw, 280px);
  aspect-ratio: 2512 / 469;
  height: auto;
}

.site-header:not(.is-solid) .brand {
  --logo-mark: #fffefa;
  --logo-word: #fffefa;
}

.site-nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 38px);
}

.site-nav a {
  position: relative;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  padding-block: 4px;
}

/* Underline grows from the left rather than fading in. */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-enter);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* Current section stays underlined rather than only on hover. */
.site-nav a.is-current::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.currency {
  display: flex;
  margin-right: 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  overflow: hidden;
  opacity: 0.85;
}

.currency button {
  padding: 5px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

/* The active pill inverts, so it is spelled out per header state rather than derived from
   currentColor — `background: currentColor` plus a transparent label cancels itself out. */
.currency button.is-active {
  background: #fffefa;
  color: var(--hana-ink);
}

.site-header.is-solid .currency button.is-active {
  background: var(--hana-ink);
  color: var(--hana-page);
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-enter);
}

.icon-button:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bag-count {
  position: absolute;
  right: 3px;
  top: 3px;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--hana-olive);
  color: #fffefa;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: var(--hana-max);
  margin-inline: auto;
  /* Clears the fixed header. */
  padding: calc(92px + env(safe-area-inset-top, 0px)) var(--hana-gutter) 0;
  font-size: 13px;
  color: var(--hana-ink-soft);
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--hana-ink);
}

.breadcrumb [aria-current="page"] {
  color: var(--hana-ink);
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */

.hero {
  padding: 10px 10px 0;
}

.hero-frame {
  position: relative;
  /*
   * width must be explicit, not auto. With an auto width, `aspect-ratio` and `max-height`
   * work against each other: once the cap binds, the browser keeps the ratio by shrinking
   * the width, and the frame pulls away from the right edge. A definite width makes the
   * ratio derive the height instead, so max-height only ever clamps the height.
   */
  width: 100%;
  aspect-ratio: 1586 / 992;
  /*
   * The artwork is 1.6:1, so on a wide screen its natural height runs past the fold.
   * Cap it to the viewport minus the 10px frame padding above and below, and let the
   * image crop rather than pushing the next section off-screen. svh keeps this honest
   * on mobile, where the browser chrome makes vh taller than what is actually visible.
   */
  max-height: calc(100vh - 20px);
  max-height: calc(100svh - 20px);
  border-radius: var(--hana-radius-panel);
  background: var(--hana-card);
}

.hero-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Favour the upper half: that is where the headline sky and the product row sit. */
  object-position: center 38%;
}

.hero-copy {
  position: absolute;
  right: clamp(20px, 4vw, 66px);
  top: clamp(88px, 11vw, 150px);
  /* Sized to the headline, so the CTA can sit flush with the right edge of "with You." */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  max-width: min(46%, 520px);
  color: #fffefa;
  text-align: left;
}

.hero-copy .pill-button {
  align-self: flex-end;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(38px, 5.6vw, 82px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hero-title .intro-mask {
  display: block;
}

.hero-sub {
  margin: 0 0 18px;
  font-size: clamp(11px, 0.9vw, 13px);
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.8;
  text-transform: uppercase;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding-inline: 28px;
  border-radius: 999px;
  background: var(--hana-olive);
  color: #fffefa;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    transform var(--dur-fast) var(--ease-enter),
    background var(--dur-fast) var(--ease-enter);
}

.pill-button:hover {
  transform: translateY(-2px);
  background: var(--hana-ink);
}

.pill-button--dark {
  background: var(--hana-ink);
}

.pill-button--dark:hover {
  background: var(--hana-olive);
}

/* ── Section heads ───────────────────────────────────────────────────────────── */

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  column-gap: 24px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.section-head .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: clamp(27px, 3.4vw, 46px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--hana-ink);
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--hana-olive);
}

/* ── Daily essentials ────────────────────────────────────────────────────────── */

.category-panel {
  padding: clamp(14px, 1.6vw, 22px);
  border-radius: var(--hana-radius-card);
  background: var(--hana-card);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 20px);
}

.category {
  display: block;
  padding: 14px 14px 18px;
  border-radius: var(--hana-radius-image);
  background: #fffefa;
  color: var(--hana-ink);
  text-decoration: none;
  transition:
    transform var(--dur-base) var(--ease-enter),
    box-shadow var(--dur-base) var(--ease-enter);
}

.category:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(24, 32, 20, 0.08);
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  font-size: clamp(15px, 1.3vw, 19px);
  font-weight: 500;
}

.category-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--hana-card);
  font-size: 13px;
  transition: transform var(--dur-fast) var(--ease-enter), background var(--dur-fast) var(--ease-enter);
}

.category:hover .category-arrow {
  transform: translate(2px, -2px);
  background: var(--hana-sky);
}

.category-media {
  display: block;
  overflow: hidden;
  border-radius: 10px;
}

.category-media img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-enter);
}

.category:hover .category-media img {
  transform: scale(1.05);
}

/* ── Rule ────────────────────────────────────────────────────────────────────── */

.simple-bar {
  max-width: var(--hana-max);
  margin-inline: auto;
  padding-inline: var(--hana-gutter);
}

.rule {
  display: block;
  width: 100%;
  height: 12px;
  color: var(--hana-line);
}

.simple-bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-block: clamp(22px, 3vw, 34px);
}

.simple-bar__text {
  margin: 0;
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Products ────────────────────────────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 46px) clamp(14px, 1.7vw, 24px);
}

.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-media {
  overflow: hidden;
  border-radius: var(--hana-radius-image);
  background: var(--hana-card);
}

.product-media img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-enter);
}

.product:hover .product-media img {
  transform: scale(1.05);
}

/* The name and image link through to the product page. They read as plain card text —
   the whole card is the affordance, not an underline. */
.product-name a,
.product-media {
  color: inherit;
  text-decoration: none;
}

.product-name a:hover {
  color: var(--hana-olive);
}

.product-brand {
  display: block;
  margin: 16px 0 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.product-name {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  /* Holds the price rows on one baseline across a row of mixed-length names. */
  min-height: 2.9em;
}

.product-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.product-price {
  font-size: clamp(16px, 1.3vw, 18px);
  font-weight: 700;
  white-space: nowrap;
}

.add-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 14px;
  border: 1px solid #a5aa96;
  border-radius: var(--hana-radius-control);
  background: transparent;
  color: var(--hana-ink);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-enter),
    border-color var(--dur-fast) var(--ease-enter);
}

.add-button:hover {
  background: var(--hana-card);
  border-color: var(--hana-olive);
}

.add-button.is-added {
  background: var(--hana-olive);
  border-color: var(--hana-olive);
  color: #fffefa;
}

/* ── Daily glow ──────────────────────────────────────────────────────────────── */

/*
 * The artwork is the entire band: its blue ground and the empty left third are part of
 * the PNG. It runs full width at its own ratio and the copy is laid over the space the
 * artwork reserves for it — the pattern the supplied starter CSS describes. Putting it
 * beside the copy in a column crops the products to half size.
 */
.routine {
  position: relative;
  width: 100%;
  aspect-ratio: 1738 / 905;
  overflow: hidden;
  border-radius: var(--hana-radius-panel);
  background: var(--hana-sky);
}

.routine-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.routine-copy {
  position: absolute;
  left: 4.5%;
  top: 50%;
  transform: translateY(-50%);
  width: 37%;
}

.routine-title {
  margin: 12px 0 14px;
  font-size: clamp(30px, 4vw, 56px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.routine-sub {
  margin: 0 0 28px;
  font-size: clamp(15px, 1.2vw, 17px);
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

.site-footer {
  max-width: var(--hana-max);
  margin-inline: auto;
  padding-inline: var(--hana-gutter);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 40px;
  padding-block: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--hana-line-soft);
}

.footer-brand p {
  margin: 10px 0 0;
  color: var(--hana-ink-soft);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-cols h3 {
  margin: 0 0 12px;
  font-size: var(--hana-eyebrow);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-cols a {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  color: var(--hana-ink-soft);
  text-decoration: none;
}

.footer-cols a:hover {
  color: var(--hana-ink);
}

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hana-line-soft);
  font-size: 13px;
  color: var(--hana-ink-soft);
}

.footer-legal a {
  margin-left: 18px;
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--hana-ink);
}

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

@media (max-width: 1080px) {
  .site-nav { display: none; }
  .product-grid,
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  /*
   * The hero and routine artwork go full-width and the copy moves out from over them.
   * A 46%-wide overlay on a phone would crop the products out of the shot entirely.
   */
  /*
   * Phones get their own portrait artwork (941x1672) with the sky in the top third, so the
   * copy sits over the sky rather than stacking beneath the image.
   */
  .hero-frame {
    aspect-ratio: auto;
    height: calc(100vh - 20px);
    height: calc(100svh - 20px);
    max-height: none;
  }

  .hero-art { object-position: center top; }

  /* The copy box spans the frame: headline and subtitle at the top over the sky, the CTA
     pushed to the bottom edge where it takes the scroll cue's place. */
  .hero-copy {
    inset: calc(112px + env(safe-area-inset-top, 0px)) 24px 28px 24px;
    width: auto;
    max-width: none;
    /* The hand enters from the left of the portrait shot; the open sky is on the right,
       so the headline and subtitle sit there, clear of the logo and the header icons. */
    align-items: flex-end;
    text-align: right;
  }

  .hero-title { margin-bottom: 10px; font-size: clamp(33px, 9.4vw, 40px); }
  .hero-sub { margin-bottom: 0; font-size: 11px; line-height: 1.55; }

  /* White so it reads over towel, jacket or product alike. */
  .hero-copy .pill-button {
    align-self: flex-start;
    margin-top: auto;
    min-height: 48px;
    padding-inline: 24px;
    background: #fffefa;
    color: var(--hana-ink);
  }



  /* The routine copy drops below the artwork, like the hero. */
  .routine { aspect-ratio: auto; }
  .routine-art { height: auto; aspect-ratio: 1738 / 905; }
  .routine-copy { position: static; width: auto; transform: none; padding: 24px 24px 28px; }

  .section-head {
    grid-template-columns: 1fr;
    justify-items: start;
    row-gap: 14px;
  }

  .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  /* Shorter frames scale the artwork down and the hand rides up; keep the copy above it. */
  .hero-title { font-size: clamp(30px, 8.8vw, 34px); }
  /* Narrower tracking keeps the subtitle's left end off the fingertips on small phones. */
  .hero-sub { font-size: 10px; letter-spacing: 0.11em; line-height: 1.45; }
}

@media (max-width: 560px) {
  .currency { display: none; }
  .product-actions { flex-wrap: wrap; }
  .product-name { min-height: 0; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 8px; }
}
