/* ===========================================
   FIANCHETTO CHESS CENTER — Links
   links.colartdigitalmarketingagency.com/fianchetto/
   Night board, gold squares. The knight makes its move.
=========================================== */

:root {
  --board:     #0d0c0a;
  --board-2:   #15130f;
  --gold:      #c39b4b;
  --gold-lt:   #e0c180;
  --gold-dk:   #9c7a35;
  --ivory:     #fcfbf8;
  --ink:       #070604;
  --text:      #f4efe4;
  --muted:     rgba(244, 239, 228, .58);
  --card:      rgba(255, 255, 255, .04);
  --card-hi:   rgba(255, 255, 255, .08);
  --line:      rgba(195, 155, 75, .22);
  --line-hi:   rgba(195, 155, 75, .55);
  --whatsapp:  #25d366;

  --font: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.5, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--board);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* checkerboard fading out from the top */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 12%, rgba(195, 155, 75, .16), transparent 70%),
    repeating-conic-gradient(rgba(195, 155, 75, .07) 0 25%, transparent 0 50%) 0 0 / 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 70%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 70%);
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: 3px; border-radius: 6px; }

/* ============ TOP BAR ============ */
.topbar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  justify-content: flex-end;
}
.share {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-hi);
  background: rgba(13, 12, 10, .6);
  color: var(--gold-lt);
  transform: rotate(45deg);
  border-radius: 6px;
  transition: background .3s, color .3s;
}
.share svg { width: 17px; height: 17px; transform: rotate(-45deg); }
.share:hover { background: var(--gold); color: var(--ink); }

/* ============ PAGE ============ */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

/* ============ HERO ============ */
.hero { text-align: center; }
.mark {
  width: clamp(250px, 76vw, 320px);
  margin: 0 auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mark svg { width: 100%; height: auto; overflow: visible; }
.mark .diamond { fill: var(--gold); transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .55)); }
.mark .rook    { fill: var(--ivory); transform-box: fill-box; transform-origin: center bottom; filter: drop-shadow(8px 6px 6px rgba(0, 0, 0, .35)); }
.mark .knight  { fill: var(--ink); transform-box: fill-box; transform-origin: center bottom; filter: drop-shadow(8px 6px 6px rgba(0, 0, 0, .35)); }
.mark .t1 { fill: var(--ivory); font-family: var(--font); font-weight: 900; font-size: 200px; letter-spacing: -2px; }
.mark .t2 { fill: var(--ivory); font-family: var(--font); font-weight: 400; font-size: 78px; letter-spacing: 22px; }
.hint { margin-top: 2px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
@media (hover: none) { .hint .desk { display: none; } }
@media (hover: hover) { .hint .touch { display: none; } }

/* ============ PRIMARY: two squares ============ */
.squares { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.sq {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 150px;
  padding: 18px;
  overflow: hidden;
  border-radius: 6px;
  transition: transform .4s var(--ease), box-shadow .4s;
}
.sq:hover { transform: translateY(-4px); }
.sq--gold  { background: linear-gradient(150deg, var(--gold-lt), var(--gold) 55%, var(--gold-dk)); color: var(--ink); box-shadow: 0 20px 40px -22px rgba(195, 155, 75, .8); }
.sq--ivory { background: var(--ivory); color: var(--ink); box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .9); }
.sq__coord { position: absolute; right: 12px; bottom: 8px; font-size: 11px; font-weight: 700; opacity: .4; }
.sq__icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(7, 6, 4, .1);
}
.sq__icon svg { width: 22px; height: 22px; }
.sq__t { display: block; font-size: 20px; font-weight: 900; line-height: 1.1; }
.sq__s { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 700; opacity: .7; }
.sq__s svg { width: 14px; height: 14px; transition: transform .35s var(--ease); }
.sq:hover .sq__s svg { transform: translateX(4px); }
.sq::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -70%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}

/* ============ SECTIONS ============ */
.label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 36px 0 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold-lt);
}
.label .piece { font-size: 18px; letter-spacing: 0; line-height: 1; }
.label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-hi), transparent); }

.links { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.link {
  --tone: var(--gold);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 16px 10px 10px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .3s, background .3s;
}
.link:hover { transform: translateX(4px); border-color: var(--tone); background: var(--card-hi); }
.link__icon {
  flex: none;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(195, 155, 75, .12);
  color: var(--gold-lt);
  transition: background .3s, color .3s, transform .45s var(--spring);
}
.link__icon svg { width: 21px; height: 21px; }
.link:hover .link__icon { background: var(--tone); color: #fff; transform: rotate(-8deg); }
.links--web { margin-top: 12px; }
.link--web { border-color: var(--line-hi); background: rgba(195, 155, 75, .08); }
.link--web:hover .link__icon { color: var(--ink); }
.link--wa { --tone: var(--whatsapp); }
.link--map { --tone: var(--gold); }
.link--map:hover .link__icon { color: var(--ink); }
.link--ig { --tone: #e1306c; }
.link--fb { --tone: #0866ff; }
.link__text { flex: 1; min-width: 0; }
.link__title { display: block; font-size: 16px; font-weight: 700; }
.link__sub { display: block; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link__go { flex: none; color: var(--muted); transition: color .3s, transform .35s var(--ease); }
.link__go svg { width: 18px; height: 18px; }
.link:hover .link__go { color: var(--gold-lt); transform: translateX(3px); }

/* ============ GET LISTED (Colart) ============ */
.listed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 36px;
  padding: 16px 16px 16px 20px;
  border-radius: 6px;
  border: 1px dashed var(--line-hi);
  transition: border-color .3s, background .3s;
}
.listed:hover { border-color: var(--whatsapp); background: var(--card); }
.listed__q { display: block; font-size: 14px; color: var(--muted); }
.listed__a { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; }
.listed__icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform .3s var(--ease);
}
.listed__icon svg { width: 22px; height: 22px; fill: currentColor; }
.listed:hover .listed__icon { transform: scale(1.08); }

/* ============ FOOTER ============ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: var(--board-2);
  color: var(--muted);
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom, 0px));
}
.footer__credits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  text-align: center;
}
.footer__credit { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 6px; }
.footer__label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
.footer a { color: var(--gold-lt); font-weight: 700; border-bottom: 1px solid transparent; transition: border-color .3s; }
.footer a:hover { border-color: var(--gold-lt); }
.footer__sep { color: rgba(244, 239, 228, .25); }
@media (max-width: 440px) { .footer__sep { display: none; } .footer__credits { flex-direction: column; } }

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 12px 20px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ ENTRANCE: "the opening" ============ */
@media (prefers-reduced-motion: no-preference) {
  /* 1. the gold square spins onto the board */
  .mark .diamond { animation: board 1s .1s cubic-bezier(.65, 0, .35, 1) both; }
  /* 2. the rook rises into place */
  .mark .rook    { animation: rook .8s .9s var(--spring) both; }
  /* 3. the knight makes an L-move: two squares up, one across, and lands */
  .mark .knight.move { animation: knight 1.1s var(--d, 1.35s) cubic-bezier(.45, 0, .25, 1) both; }
  /* 4. the name is set */
  .mark .t1 { animation: rise .8s 2.2s var(--ease) both; }
  .mark .t2 { animation: rise .8s 2.35s var(--ease) both; }
  .hint  { animation: fade .8s 2.8s ease both; }
  .sq:nth-child(1) { animation: rise .8s 2.4s var(--ease) both; }
  .sq:nth-child(2) { animation: rise .8s 2.5s var(--ease) both; }
  .sq:nth-child(1)::after { animation: sheen 1.3s 3.1s ease both; }
  .sq:nth-child(2)::after { animation: sheen 1.3s 3.3s ease both; }
  .label, .links li, .listed { animation: rise .7s var(--ease) both; }
  .links--web li { animation-delay: 2.55s; }
  .label:nth-of-type(1) { animation-delay: 2.6s; }
  .links--contact li:nth-child(1) { animation-delay: 2.66s; }
  .links--contact li:nth-child(2) { animation-delay: 2.72s; }
  .label:nth-of-type(2) { animation-delay: 2.78s; }
  .links--follow li:nth-child(1) { animation-delay: 2.84s; }
  .links--follow li:nth-child(2) { animation-delay: 2.9s; }
  .listed { animation-delay: 3s; }
}
@keyframes board {
  from { opacity: 0; transform: rotate(-180deg) scale(.2); }
  to   { opacity: 1; transform: none; }
}
@keyframes rook {
  from { opacity: 0; transform: translateY(60%) scale(.9); }
  to   { opacity: 1; transform: none; }
}
/* L-move in the knight's own units (fill-box %): start low-left, up two, across one */
@keyframes knight {
  0%   { opacity: 0; transform: translate(-110%, 120%) scale(.85); }
  12%  { opacity: 1; }
  45%  { transform: translate(-110%, -45%) scale(1.08); }
  75%  { transform: translate(0, -45%) scale(1.08); }
  88%  { transform: translate(0, 4%) scale(1.02, .96); }
  100% { opacity: 1; transform: none; }
}
@keyframes rise  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheen { from { left: -70%; } to { left: 130%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
