/* Praça de Toiros · alloic — the page is an azulejo panel set into a whitewashed Angra wall. */
:root {
  --paper: #F8F9FB;          /* glazed tile white, cool */
  --wall: #E8ECF2;           /* limewash in shade */
  --ink: #10285C;            /* cobalt ink, darkest */
  --muted: #3D4966;
  --cobalt: #1C4597;
  --navy: #0E2250;
  --tone: #D9E1EF;           /* one step off the wall, for the second action */
  --grout: #C9D0DC;
  --on-dark: #F8F9FB;

  --f: "Lora", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  /* the page's five sizes */
  --t-display: clamp(50px, 6.2vw, 96px);
  --t-h2: clamp(30px, 3.2vw, 44px);
  --t-lead: 24px;
  --t-body: 19px;
  --t-small: 16px;

  --m: clamp(16px, 2.2vw, 32px);   /* the one pair of outer margins */
  --gap: clamp(110px, 13vw, 190px);
  --scallop: 26px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--f);
  font-feature-settings: "lnum", "tnum";
}
img, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
::selection { background: var(--cobalt); color: var(--paper); }
main { overflow-x: clip; }

/* ---- type ---- */
.display { font-size: var(--t-display); font-style: italic; font-weight: 500; line-height: .98; letter-spacing: -.02em; }
.h2, .sheet-name, .sign-off { font-size: var(--t-h2); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; }
.lead, .mark, .edition-title, .group-name, .ticket-title, .total { font-size: var(--t-lead); line-height: 1.4; }
.body-l { font-size: var(--t-body); line-height: 1.58; max-width: 40ch; }
.links a, .lang, .note, .stock-line, .item-desc, .field-label, .alt-ways, .imprint, .photo-hint, .strip, .facts, .stub-name, .stub-line, .cell, .btn { font-size: var(--t-small); }

/* ---- buttons: flat, square, one fill ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 0 26px;
  font-family: var(--f); font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 0;
  transition: transform .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--cobalt); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: var(--tone); }
.btn-big { min-height: 62px; padding: 0 34px; font-size: var(--t-body); }
.btn-full { width: 100%; }

/* ---- hero: the tiled wall and the panel set into it ---- */
.hero {
  position: relative; overflow: clip;
  background: var(--wall) url("assets/tiles.jpg") repeat 0 0 / 620px auto;
  padding: 0 var(--m) 140px;
}
.bar {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  margin: 0 calc(-1 * var(--m)); padding: 14px var(--m);
  background: var(--paper);
}
.mark { font-style: italic; font-weight: 500; text-decoration: none; letter-spacing: -.02em; }
.links { display: flex; gap: 34px; }
.links a { text-decoration: none; padding: 8px 2px; transition: color .18s; }
.links a:hover { color: var(--cobalt); text-decoration: underline; text-underline-offset: 6px; }
.bar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.lang {
  font-family: var(--f); font-weight: 500; line-height: 1; color: var(--ink); background: var(--tone);
  border: 0; min-height: 52px; padding: 0 18px; cursor: pointer; transition: background-color .18s;
}
.lang:hover { background: var(--grout); }

.panel {
  position: relative;
  width: min(760px, 100%);
  margin: 56px auto 0;
  background: var(--paper);
  padding: 50px 60px 60px;
  text-align: center;
  --r: var(--scallop);
  -webkit-mask:
    radial-gradient(circle at 0 0, #0000 var(--r), #000 calc(var(--r) + .5px)) top left, /* taste-skill-ignore: hard-edged mask cutting the tile's scallops, not a colour fill */
    radial-gradient(circle at 100% 0, #0000 var(--r), #000 calc(var(--r) + .5px)) top right, /* taste-skill-ignore: hard-edged mask */
    radial-gradient(circle at 0 100%, #0000 var(--r), #000 calc(var(--r) + .5px)) bottom left, /* taste-skill-ignore: hard-edged mask */
    radial-gradient(circle at 100% 100%, #0000 var(--r), #000 calc(var(--r) + .5px)) bottom right; /* taste-skill-ignore: hard-edged mask */
  -webkit-mask-size: 51% 51%; -webkit-mask-repeat: no-repeat;
  mask:
    radial-gradient(circle at 0 0, #0000 var(--r), #000 calc(var(--r) + .5px)) top left, /* taste-skill-ignore: hard-edged mask */
    radial-gradient(circle at 100% 0, #0000 var(--r), #000 calc(var(--r) + .5px)) top right, /* taste-skill-ignore: hard-edged mask */
    radial-gradient(circle at 0 100%, #0000 var(--r), #000 calc(var(--r) + .5px)) bottom left, /* taste-skill-ignore: hard-edged mask */
    radial-gradient(circle at 100% 100%, #0000 var(--r), #000 calc(var(--r) + .5px)) bottom right; /* taste-skill-ignore: hard-edged mask */
  mask-size: 51% 51%; mask-repeat: no-repeat;
}
.panel h1 .l1, .panel h1 .l2 { display: block; }
.panel h1 .l1 { transform: translateX(-5%); }
.panel h1 .l2 { transform: translateX(7%); color: var(--cobalt); }
.panel .lead { margin: 26px auto 0; max-width: 30ch; }
.facts { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; }
.facts b { font-weight: 600; }
.diamond { width: 10px; height: 10px; background: var(--cobalt); transform: rotate(45deg); display: inline-block; }
.hero-act { margin-top: 28px; display: grid; justify-items: center; gap: 14px; }
.stock-line { color: var(--muted); }
.plate { margin: 40px -20px 0; overflow: hidden; }
.plate img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; animation: drift 22s var(--ease) infinite alternate; }

/* ---- showcase: square plate, spare text ---- */
.showcase {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh;
  background: var(--wall); padding: 120px var(--m) 0;
}
.show-photo { padding: 0 40px 0 0; align-self: start; }
.show-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity .35s var(--ease); }
.show-photo img.swap { opacity: 0; }
.show-text { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 8px 0 8px 40px; }
.tabs { display: flex; gap: 28px; }
.tabs button {
  font: 500 var(--t-body)/1 var(--f); color: var(--muted); background: none; border: 0; padding: 10px 0; cursor: pointer;
  transition: color .18s;
}
.tabs button[aria-selected="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 10px; }
.tabs button:hover { color: var(--cobalt); }
.show-copy .h2 { max-width: 14ch; }
.show-copy .body-l { margin-top: 44px; max-width: 34ch; }
.cells { display: grid; grid-template-columns: 1fr 1fr; }
.cell { display: flex; align-items: center; justify-content: center; min-height: 76px; padding: 0 18px; text-decoration: none; font-weight: 600; text-align: center; transition: background-color .18s var(--ease), transform .18s var(--ease); }
.cell:active { transform: scale(.98); }
.cell-ink { background: var(--ink); color: var(--paper); }
.cell-ink:hover { background: var(--cobalt); }
.cell-tone { background: var(--tone); color: var(--ink); }
.cell-tone:hover { background: var(--grout); }

/* ---- gallery: prints with swing tags ---- */
.gallery { background: var(--wall); padding: 130px var(--m) 0; }
.gallery .h2 { margin-bottom: 40px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 12px; }
.tile { overflow: hidden; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .6s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.strip { display: grid; gap: 6px; min-height: 88px; padding: 12px 14px; align-content: start; }
.strip p { display: flex; justify-content: space-between; gap: 10px; }
.row2 span:first-child { font-weight: 600; }
.p1 .strip { background: var(--cobalt); color: var(--on-dark); }
.p2 .strip { background: var(--paper); color: var(--ink); }
.p3 .strip { background: var(--navy); color: var(--on-dark); }
.p4 .strip { background: var(--tone); color: var(--ink); }

/* ---- three sheets, stacking like tiles in their box ---- */
.sheets { background: var(--wall); padding: var(--gap) 0 0; }
.sheets-h { margin: 0 var(--m) 48px; }
.sheet {
  position: sticky; top: calc(var(--i, 0) * 72px);
  display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: 72px minmax(0, 1fr); column-gap: 24px;
  height: 74svh; min-height: 560px; padding: 0 0 0 var(--m); margin-bottom: 5svh;
}
/* each sheet is one band shorter than the last, so all three bottoms meet and the stack leaves together */
.sheet:nth-of-type(1) { --i: 0; }
.sheet:nth-of-type(2) { --i: 1; height: calc(74svh - 72px); min-height: 488px; }
.sheet:nth-of-type(3) { --i: 2; height: calc(74svh - 144px); min-height: 416px; margin-bottom: 0; }
.s-cobalt { background: var(--cobalt); color: var(--on-dark); }
.s-paper { background: var(--paper); color: var(--ink); }
.s-navy { background: var(--navy); color: var(--on-dark); }
.sheet-name { grid-column: 1 / 8; grid-row: 1; align-self: center; }
.sheet-body { grid-column: 1 / 6; grid-row: 2; align-self: start; display: grid; gap: 28px; justify-items: start; padding: 36px 0 44px; }
.sheet-photo { grid-column: 7 / 13; grid-row: 2; position: relative; overflow: hidden; min-height: 0; }
.sheet-photo img, .sheet-photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.glow canvas { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease); }
.glow.has-photo canvas { opacity: 1; animation: breathe 6s ease-in-out infinite alternate; }
.try { display: grid; gap: 12px; justify-items: start; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.note { color: var(--muted); }

/* ---- prices, like a menu ---- */
.prices {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  background: var(--paper); margin-top: var(--gap); padding: 120px var(--m);
}
.prices-side { grid-column: 1 / 5; display: grid; align-content: start; gap: 40px; }
.edition-title { font-weight: 500; }
.stock-tiles { list-style: none; margin: 16px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; max-width: 360px; }
.stock-tiles li { aspect-ratio: 1; background: var(--grout); }
.stock-tiles li.left { background: var(--paper) url("assets/tile.jpg") center / cover; }
.edition-copy { color: var(--ink); max-width: 32ch; }
.menu { grid-column: 5 / 13; columns: 2; column-gap: 64px; }
.group { break-inside: avoid; padding-top: 48px; }
.group:first-child { padding-top: 6px; }
.group-name { font-weight: 500; margin-bottom: 18px; }
.item { display: flex; justify-content: space-between; gap: 16px; font-weight: 500; }
.item b { font-weight: 600; white-space: nowrap; }
.item-desc { color: var(--muted); max-width: 36ch; margin: 4px 0 22px; }
.group-set .btn { margin-top: 6px; }
.saving { font-size: var(--t-small); color: var(--cobalt); font-weight: 600; margin: -10px 0 18px; }

/* ---- the order: a ticket on the photograph of the place ---- */
.order { position: relative; min-height: 118svh; padding: 60px 0 90px; background: var(--navy); overflow: clip; }
.order-photo, .order-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.order-photo img { animation: drift 26s var(--ease) infinite alternate; }
.ticket {
  position: sticky; top: 40px; z-index: 1;
  width: min(470px, calc(100% - 2 * var(--m)));
  margin: 0 var(--m) 0 auto;
  background: var(--paper); color: var(--ink);
  --n: 16px;
  -webkit-mask:
    radial-gradient(circle at 0 calc(100% - 118px), #0000 var(--n), #000 calc(var(--n) + .5px)) left / 51% 100% no-repeat, /* taste-skill-ignore: hard-edged mask cutting the ticket's notches */
    radial-gradient(circle at 100% calc(100% - 118px), #0000 var(--n), #000 calc(var(--n) + .5px)) right / 51% 100% no-repeat; /* taste-skill-ignore: hard-edged mask */
  mask:
    radial-gradient(circle at 0 calc(100% - 118px), #0000 var(--n), #000 calc(var(--n) + .5px)) left / 51% 100% no-repeat, /* taste-skill-ignore: hard-edged mask */
    radial-gradient(circle at 100% calc(100% - 118px), #0000 var(--n), #000 calc(var(--n) + .5px)) right / 51% 100% no-repeat; /* taste-skill-ignore: hard-edged mask */
}
.ticket-main { padding: 32px 32px 26px; display: grid; gap: 16px; }
.ticket-title { font-weight: 600; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choices legend { padding: 0; margin-bottom: 8px; }
.choice, .check {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 14px; background: var(--wall); cursor: pointer;
  transition: background-color .18s var(--ease);
}
.choice:hover, .check:hover { background: var(--tone); }
.choice:has(input:checked), .check:has(input:checked) { background: var(--ink); color: var(--paper); }
.choice input, .check input { width: 24px; height: 24px; margin: 0; accent-color: var(--cobalt); }
.choice b, .check b { font-weight: 600; }
.field { display: grid; gap: 6px; }
.field input {
  font: 400 var(--t-body)/1.2 var(--f); color: var(--ink); background: var(--paper);
  min-height: 56px; padding: 0 14px; border: 2px solid var(--grout); border-radius: 0;
}
.field input:focus { border-color: var(--cobalt); outline: none; }
.field input[aria-invalid="true"] { border-color: #A3261E; }
.photo-hint { color: var(--ink); background: var(--tone); padding: 12px 14px; }
.total { display: flex; justify-content: space-between; font-weight: 600; padding-top: 4px; }
.alt-ways { display: grid; gap: 6px; text-align: center; }
.alt-ways a { color: var(--ink); text-underline-offset: 4px; }
.ticket-stub { border-top: 6px dotted var(--cobalt); margin: 0 18px; padding: 24px 14px 28px; text-align: center; display: grid; gap: 6px; }
.stub-name { font-weight: 600; color: var(--cobalt); }
.stub-line { color: var(--muted); }

/* ---- questions, as reading text ---- */
.faq { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; background: var(--paper); padding: var(--gap) var(--m); }
.faq .h2 { grid-column: 1 / 4; }
.faq-text { grid-column: 5 / 13; columns: 2; column-gap: 56px; line-height: 1.55; }
.faq-text p { break-inside: avoid; margin-bottom: 22px; max-width: 36ch; }
.faq-text b { font-weight: 600; }

/* ---- the back of the card ---- */
.back { background: var(--cobalt) url("assets/tiles.jpg") repeat 0 0 / 520px auto; padding: 110px var(--m) 70px; }
.postcard {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  width: min(1180px, 100%); margin: 0 auto; min-height: 420px;
  background: var(--paper); padding: 90px 56px 40px;
  -webkit-mask: radial-gradient(circle at 50% 0, #0000 49px, #000 50px) top / 100px 100% repeat-x; /* taste-skill-ignore: hard-edged mask cutting the postcard's scalloped edge */
  mask: radial-gradient(circle at 50% 0, #0000 49px, #000 50px) top / 100px 100% repeat-x; /* taste-skill-ignore: hard-edged mask */
}
.sign-off { font-style: italic; font-weight: 500; }
.pc-msg { margin-top: 18px; max-width: 34ch; }
.pc-right { position: relative; padding-top: 6px; }
.stamp { position: absolute; top: -24px; right: 0; width: 104px; padding: 6px; background: var(--tone); transform: rotate(3deg); }
.addr { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.addr a { text-underline-offset: 5px; }
.imprint { grid-column: 1 / -1; align-self: end; text-align: center; color: var(--muted); padding-top: 40px; }

/* the street at the foot of the wall: calçada waves */
.calcada { height: 96px; margin: 70px calc(-1 * var(--m)) -70px; background: #2B2B2D url("assets/calcada.jpg") repeat-x 0 50% / auto 100%; }
@media (max-width: 760px) { .calcada { height: 64px; margin-bottom: -40px; } }

/* ---- motion ---- */
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.07) translateY(-1.5%); } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.025); } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.js .panel { animation: rise .9s var(--ease) both; }
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .stock-tiles.in li { animation: pop .45s var(--ease) both; animation-delay: calc(var(--k) * 18ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---- tablet ---- */
@media (max-width: 1080px) {
  .links { gap: 20px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .menu { columns: 1; grid-column: 7 / 13; }
  .prices-side { grid-column: 1 / 6; }
}
@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; min-height: 0; }
  .show-photo { padding: 0; }
  .show-text { padding: 32px 0 0; gap: 32px; }
  .faq .h2 { grid-column: 1 / -1; margin-bottom: 28px; }
  .faq-text { grid-column: 1 / -1; }
}

/* ---- phone: its own composition ---- */
@media (max-width: 760px) {
  :root { --t-body: 18px; --t-lead: 20px; --t-h2: 28px; --scallop: 18px; }
  .hero { background-size: 380px auto; padding-bottom: 80px; }
  .bar { grid-template-columns: auto 1fr; }
  .links { display: none; }
  .lang { padding: 0 14px; }
  .panel { margin-top: 40px; padding: 44px 20px 28px; }
  .display { font-size: 10.5vw; }
  .panel h1 .l1, .panel h1 .l2 { transform: none; }
  .plate { margin: 40px -6px 0; }
  .plate img { aspect-ratio: 2 / 3; }

  .showcase { padding-top: 100px; }
  .tabs { order: -1; gap: 22px; }
  .show-copy .body-l { margin-top: 18px; }
  .cells { grid-template-columns: 1fr; }
  .cell { min-height: 60px; }

  .gallery { padding-top: 100px; }
  .gallery .h2 { margin-bottom: 24px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 16px 8px; }
  .strip { min-height: 0; padding: 10px; }
  .strip .row3 { flex-wrap: wrap; }
  .strip .row2 { display: none; }

  .sheets { padding-top: 100px; }
  .sheet, .sheet:nth-of-type(2), .sheet:nth-of-type(3) { position: relative; top: 0; grid-template-columns: 1fr; grid-template-rows: 52px auto auto; height: auto; min-height: 0; padding: 0; margin-bottom: 0; }
  .sheet-name { grid-column: 1; grid-row: 1; font-size: var(--t-lead); padding: 0 var(--m); }
  .sheet-photo { grid-column: 1; grid-row: 2; aspect-ratio: 4 / 3; }
  .sheet-body { grid-column: 1; grid-row: 3; padding: 22px var(--m) 30px; gap: 20px; }

  .prices { display: block; padding: 90px var(--m); margin-top: 100px; }
  .prices-side { gap: 24px; margin-bottom: 40px; }
  .group { padding-top: 40px; }

  .order { min-height: 0; padding-bottom: 40px; }
  .order-photo { position: relative; display: block; height: 70svh; }
  .ticket { position: relative; top: 0; margin: -80px auto 0; width: calc(100% - 2 * var(--m)); }
  .order { padding: 0 0 40px; }
  .ticket-main { padding: 26px 18px 20px; }

  .faq { display: block; padding: 100px var(--m) 110px; }
  .faq-text { columns: 1; }
  .faq-text p { margin-bottom: 18px; }

  .back { padding: 70px var(--m) 40px; background-size: 360px auto; }
  .postcard { grid-template-columns: 1fr; padding: 70px 22px 28px; min-height: 0;
    -webkit-mask-size: calc(100% / 6) 100%; mask-size: calc(100% / 6) 100%; }
  .stamp { width: 72px; top: -22px; }
  .sign-off { padding-right: 80px; }
}
