/* PURO's colours, sampled from the logo, cups and packaging */
:root {
  --ground: #f6fdfe;
  --ink: #2a0f3d;
  --soft: #5b4470;
  --aqua: #8fe9ef;
  --teal: #1f9d92;
  --purple: #6f2a9b;
  --orchid: #a9459b;
  --lilac: #dcb6ee;
  --yellow: #ffe070;
  --lime: #c4ea7d;
  --white: #ffffff;

  --font-display: "Chango", "Fredoka", sans-serif;
  --font-text: "Fredoka", system-ui, sans-serif;
  --display-scale: 1;

  --step-small: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  --step-hero: min(10.2vw, 5rem);

  --gutter: clamp(1rem, 2.2vw, 2rem);
  --section-gap: clamp(5rem, 10vw, 9rem);
  --radius: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dir: 1;
}

html[lang="ar"] {
  --font-display: "Lalezar", "Baloo Bhaijaan 2", sans-serif;
  --font-text: "Baloo Bhaijaan 2", system-ui, sans-serif;
  --display-scale: 1.25;
  --dir: -1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.5;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
}
h1 { font-size: calc(var(--step-hero) * var(--display-scale)); }
h2 { font-size: calc(var(--step-head) * var(--display-scale)); color: var(--orchid); }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding-inline: 1.75rem;
  border-radius: 999px;
  background: var(--purple);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  transition: transform 180ms var(--ease), background-color 180ms ease;
}
.btn:hover { background: var(--orchid); }
.btn:active { transform: scale(0.95); }
.btn-dark { background: var(--ink); }
.text-link { font-weight: 500; text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; }

.tone-aqua { background: var(--aqua); }
.tone-lilac { background: var(--lilac); }
.tone-yellow { background: var(--yellow); }
.tone-lime { background: var(--lime); }

/* First screen: banner plus hero, one screen tall */
.first { height: 100svh; min-height: 620px; display: flex; flex-direction: column; }
.demo-banner {
  padding: 0.4rem var(--gutter);
  background: var(--ink);
  color: var(--white);
  font-size: var(--step-small);
  text-align: center;
}
.hero {
  flex: 1;
  min-height: 0;
  background: var(--aqua);
  padding: 0.75rem var(--gutter) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}
.hero-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.logo { width: 60px; height: 60px; transition: transform 300ms var(--ease); }
.logo:hover { transform: rotate(calc(-8deg * var(--dir))) scale(1.06); }
.hero-nav { display: flex; align-items: center; font-weight: 500; font-size: 1rem; }
.hero-nav a, .lang-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.5rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-color 180ms ease;
}
.hero-nav a:hover, .lang-toggle:hover { text-decoration-color: currentColor; }
.about { margin-block-start: 0.75rem; max-inline-size: 30ch; font-size: 1.125rem; line-height: 1.35; }
.hero-actions { display: flex; align-items: center; gap: 1.25rem; margin-block-start: 1rem; }

.mosaic {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 8fr 3fr 3fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 8px;
  margin-inline-end: calc(-1 * var(--gutter));
}
.tile { position: relative; overflow: hidden; border-radius: var(--radius); }
.mosaic > .tile:nth-child(1) { grid-row: 1 / 4; background: #60cce7; }
.tile-tall { grid-row: 1 / 3; }
.tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-cup img { object-fit: contain; padding: 10%; transition: transform 400ms var(--ease); }
.tile-cup:hover img { transform: scale(1.08) rotate(calc(-3deg * var(--dir))); }
.mosaic .tile-cup[data-cup="0"] { grid-column: 3; grid-row: 1 / 3; border-start-end-radius: 0; border-end-end-radius: 0; }
.mosaic .tile-cup[data-cup="1"] { grid-column: 2; grid-row: 3; }
.mosaic .tile-cup[data-cup="2"] { grid-column: 3; grid-row: 3; border-start-end-radius: 0; border-end-end-radius: 0; }
#hero-photos img { opacity: 0; transition: opacity 1.6s ease; }
#hero-photos img:first-child { object-position: 40% 30%; }
#hero-photos img.on { opacity: 1; }

/* Menu: every item alone on its own colour */
.menu { padding: var(--section-gap) var(--gutter); }
.menu-head { display: flex; flex-direction: column; gap: 0.5rem; }
.sides { display: flex; gap: 8px; margin-block-start: 1.75rem; }
.side {
  flex: 1;
  min-height: 52px;
  padding-inline: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-lead);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms var(--ease);
}
.side:hover { background: var(--yellow); }
.side:active { transform: scale(0.97); }
.side[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 0.75rem; }
.tab {
  min-height: 44px;
  padding-inline: 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--aqua);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms var(--ease);
}
.tab:hover { background: var(--lilac); }
.tab:active { transform: scale(0.95); }
.tab[aria-pressed="true"] { background: var(--purple); color: var(--white); }
/* Tiles grow to fill each row, so a short last row never leaves a hole */
.catalogue {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 8px;
  margin-block-start: 1.75rem;
}
.specimen { flex: 1 1 calc(50% - 4px); min-width: 0; }
.specimen.in { animation: tile-in 600ms var(--ease) backwards; animation-delay: calc(var(--i) * 50ms); }
@keyframes tile-in { from { opacity: 0; transform: translateY(20px) scale(0.97); } }
.specimen .tile { height: clamp(210px, 22vw, 320px); }
.specimen .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 1rem; transition: transform 400ms var(--ease); }
.specimen:hover .tile img { transform: scale(1.07) rotate(calc(-3deg * var(--dir))); }
.specimen p { margin-block-start: 0.5rem; font-weight: 500; line-height: 1.25; }
.hot-lists { flex: 1 1 100%; display: grid; gap: 8px; }
.hot-list { padding: 1.5rem; border-radius: var(--radius); }
.hot-list.in { animation: tile-in 600ms var(--ease) backwards; }
.hot-list li { font-size: var(--step-lead); font-weight: 500; line-height: 1.5; }

/* Fill your cup */
.cup { background: var(--purple); color: var(--white); padding: var(--section-gap) var(--gutter); display: grid; gap: 2.5rem; }
.cup h2 { color: var(--white); }
.cup h3 { font-size: var(--step-lead); font-weight: 500; margin-block-start: 1.75rem; }
.cup-stage { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.chip[hidden], .cup-hint[hidden] { display: none; }
.cup-hint { font-weight: 500; text-align: center; }
#cup-svg { width: min(70vw, 340px); height: auto; }
.straw { fill: var(--aqua); }
.cup-glass { fill: rgba(255, 255, 255, 0.16); }
.cup-rim { fill: var(--white); }
.cup-shine { fill: rgba(255, 255, 255, 0.28); }
#cup-layers rect { transition: fill 500ms ease; }
.pearl { animation: pearl-drop 700ms var(--ease) backwards; animation-delay: calc(var(--i) * 28ms); transition: fill 300ms ease; }
@keyframes pearl-drop { from { transform: translateY(-300px); opacity: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 0.75rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding-inline: 0.75rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms var(--ease);
}
.chip:hover { background: rgba(255, 255, 255, 0.3); }
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] { background: var(--white); color: var(--ink); }
.swatch { width: 20px; height: 20px; border-radius: 50%; flex: none; background: var(--c); }
.cup-result { margin-block-start: 1.75rem; font-size: var(--step-lead); font-weight: 500; }

/* Gallery: prints with a colour strip attached */
.gallery { padding: var(--section-gap) var(--gutter); }
.prints { display: grid; gap: 1.5rem; margin-block-start: 1.75rem; }
.print { overflow: hidden; border-radius: var(--radius); }
.print .frame { aspect-ratio: 4 / 5; overflow: hidden; }
.print img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.print:hover img { transform: scale(1.04); }
.print figcaption { padding: 1rem 1.25rem 1.25rem; }
.print strong { display: block; font-weight: 600; font-size: var(--step-lead); line-height: 1.25; }
.print { margin: 0; }

/* Find us: a ticket with a perforated edge */
.find { padding: 0 var(--gutter) var(--section-gap); }
.ticket {
  position: relative;
  background: var(--yellow);
  border-radius: var(--radius);
  display: grid;
}
.ticket-words, .ticket-details { padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.ticket h2 { color: var(--ink); }
.ticket-details { border-block-start: 5px dotted var(--ground); align-items: stretch; }
.ticket-place { font-size: var(--step-lead); font-weight: 600; }
.ticket .btn { margin-block-start: 0.25rem; }

/* Footer: the last rows of the board */
.foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 8px 8px; }
.foot-tile { border-radius: var(--radius); padding: 1.25rem; min-height: 150px; }
.foot-word {
  grid-column: 1 / -1;
  background: var(--ink);
  color: var(--aqua);
  font-family: "Chango", sans-serif;
  font-size: 22vw;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.foot-cta {
  grid-column: 1 / -1;
  order: -1;
  background: var(--orchid);
  color: var(--white);
  font-family: var(--font-display);
  font-size: calc(var(--step-lead) * 1.2 * var(--display-scale));
  line-height: 1.1;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: background-color 180ms ease;
}
.foot-cta:hover { background: var(--purple); }
.foot-cta svg { align-self: flex-end; transition: transform 300ms var(--ease); }
.foot-cta:hover svg { transform: translateY(-6px); }
.foot-nav { background: var(--lime); display: flex; flex-direction: column; }
.foot-nav a { min-height: 32px; text-underline-offset: 3px; }
.foot-social { background: var(--lilac); }
.foot-social a { font-weight: 600; text-underline-offset: 3px; }
.foot-legal { grid-column: 1 / -1; background: var(--aqua); min-height: 0; }

/* Entrances */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.reveal.in { animation: rise 700ms var(--ease) backwards; animation-delay: var(--delay, 0ms); }

@media (min-width: 700px) {
  .specimen { flex-basis: calc(25% - 6px); }
  .specimen-big { flex-basis: calc(50% - 4px); }
  .specimen-big p { font-size: var(--step-lead); }
  .side { flex: none; }
  .hot-lists { grid-template-columns: repeat(3, 1fr); }
  .prints { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ticket { grid-template-columns: 46fr 54fr; }
  .ticket-words, .ticket-details { padding: 3rem; }
  .ticket-words { justify-content: space-between; }
  .ticket-details { border-block-start: 0; border-inline-start: 5px dotted var(--ground); }
  .ticket::before, .ticket::after {
    content: "";
    position: absolute;
    inset-inline-start: calc(46% - 14px);
    width: 28px;
    height: 14px;
    background: var(--ground);
  }
  .ticket::before { top: 0; border-radius: 0 0 14px 14px; }
  .ticket::after { bottom: 0; border-radius: 14px 14px 0 0; }
  .foot { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .foot-word { font-size: 18vw; min-height: 240px; }
  .foot-nav { grid-column: span 4; min-height: 200px; }
  .foot-social { grid-column: span 4; }
  .foot-legal { grid-column: span 4; }
}

@media (min-width: 1000px) {
  :root { --step-hero: clamp(3.25rem, 5vw, 6rem); }
  .hero {
    display: grid;
    grid-template-columns: clamp(30rem, 44vw, 44rem) 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 2.5rem;
    padding-block: 1rem var(--gutter);
  }
  .hero-bar { grid-column: 1 / -1; }
  .hero-words { align-self: center; }
  .mosaic { min-height: 0; grid-template-columns: 6fr 3fr 3fr; }
  #hero-photos img:first-child { object-position: 24% 30%; }
  .foot-word { grid-column: span 8; font-size: 12vw; min-height: 320px; }
  .foot-cta { grid-column: span 4; order: 0; }
  .specimen { flex-basis: calc(20% - 7px); }
  .specimen-big { flex-basis: calc(40% - 5px); }
  .cup { grid-template-columns: 5fr 7fr; align-items: center; column-gap: 2.5rem; }
  #cup-svg { width: min(30vw, 420px); }
  .menu-head { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal.in, .specimen.in, .hot-list.in, .pearl { animation: none; }
  #hero-photos img { transition: none; }
  .btn, .side, .tab, .chip, .logo, .tile-cup img, .specimen .tile img, .print img, .foot-cta svg { transition: none; }
}
