/* ==========================================================
   Mastery Academy — Link in Bio
   All brand colours live in :root. Edit them here only.
   ========================================================== */

:root {
  /* Brand palette (from the Mastery Academy brand guidelines) */
  --brand-brown: #B57B1B;        /* Primary */
  --brand-brown-logo: #AC742A;   /* Logo body tone */
  --brand-brown-deep: #6B4510;   /* Text-safe brown (AA on white) */
  --brand-brown-ink: #3D2808;    /* Headings */
  --brand-gold: #FFBF00;         /* Secondary / accents / buttons */
  --brand-gold-hover: #FFC824;
  --brand-gold-soft: #FFE7B3;    /* Light yellow */
  --brand-cream: #FFF8EA;        /* Warm neutral surface */
  --brand-sand: #F1E4CC;         /* Warm hairlines */
  --brand-espresso: #4E3209;     /* Dark brown — primary (WhatsApp) button */
  --brand-espresso-hover: #5E3D0C;
  --brand-honey: #FFE08A;        /* Soft golden yellow — website button */
  --brand-honey-hover: #FFD766;
  --brand-honey-edge: #F0C24A;
  --brand-linen: #FCF8F1;        /* Very light warm neutral — social buttons */
  --brand-linen-hover: #FAF1E1;
  --brand-border: #E3CFA6;       /* Subtle brown border (visible, not washed out) */

  /* Neutrals */
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --text: #1F1F1F;
  --text-muted: #5B544B;

  /* Platform colours (official) */
  --whatsapp: #25D366;
  --facebook: #0866FF;
  --tiktok: #000000;
  --tiktok-cyan: #25F4EE;
  --tiktok-red: #FE2C55;
  --instagram: linear-gradient(45deg, #FEDA75 0%, #FA7E1E 25%, #D62976 55%, #962FBF 78%, #4F5BD5 100%);

  /* Shape & motion */
  --radius-card: 16px;
  --radius-tile: 12px;
  --arrow-size: 30px;
  --shadow-card: 0 1px 2px rgba(61, 40, 8, .05);
  --shadow-hover: 0 2px 4px rgba(61, 40, 8, .06), 0 8px 18px -10px rgba(107, 69, 16, .28);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Faint geometric band at the top — eight‑pointed stars in warm sand */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 260px;
  z-index: 0;
  pointer-events: none;
  background-color: var(--brand-cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23F1E3C5' stroke-width='1'%3E%3Crect x='18' y='18' width='20' height='20'/%3E%3Crect x='18' y='18' width='20' height='20' transform='rotate(45 28 28)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Header ---------- */

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Arch-shaped crest echoing the arches in the logo */
.crest {
  width: 100px;
  height: 114px;
  display: grid;
  place-items: center;
  padding-top: 8px;
  background: var(--bg);
  border: 1px solid var(--brand-sand);
  border-radius: 50px 50px 18px 18px;
  box-shadow: 0 1px 2px rgba(61, 40, 8, .04), 0 10px 22px -14px rgba(107, 69, 16, .3);
}

.crest img {
  display: block;
  width: 56px;
  height: auto;            /* keeps the 4:5 logo ratio — never distorted */
  aspect-ratio: 256 / 320;
}

.brand {
  margin: 16px 0 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-brown-ink);
}

.swoosh {
  display: block;
  width: 76px;
  height: 9px;
  margin-top: 6px;
  color: var(--brand-gold);
}

.subtitle {
  margin: 10px 0 0;
  text-wrap: balance;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--brand-brown-deep);
}

.welcome {
  margin: 4px 0 0;
  text-wrap: balance;
  max-width: 34ch;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ---------- Links ---------- */

main { margin-top: 22px; }

.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 8px 14px 8px 9px;
  border-radius: var(--radius-card);
  background: var(--brand-linen);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .22s var(--ease),
    box-shadow .22s var(--ease),
    border-color .22s var(--ease),
    background-color .22s var(--ease);
}

.link:hover {
  transform: translateY(-2px);
  background: var(--brand-linen-hover);
  border-color: var(--brand-brown);
  box-shadow: var(--shadow-hover);
}

.link:active {
  transform: translateY(0) scale(.985);
  transition-duration: .08s;
}

.link:focus-visible {
  outline: 3px solid var(--brand-brown-deep);
  outline-offset: 3px;
}

.tile {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-tile);
  display: grid;
  place-items: center;
  color: #fff;
}

.tile svg { width: 23px; height: 23px; display: block; }

.tile--whatsapp  { background: var(--whatsapp); }
.tile--whatsapp svg { width: 25px; height: 25px; }
.tile--web       { background: var(--bg); color: var(--brand-brown-deep); }
.tile--instagram { background: var(--instagram); }
.tile--facebook  { background: var(--facebook); }
.tile--facebook svg { width: 25px; height: 25px; }
.tile--tiktok    { background: var(--tiktok); }

/* TikTok's signature offset glow, built from three stacked glyphs */
.tile--tiktok svg { position: absolute; width: 20px; height: 20px; top: 50%; left: 50%; }
.tile--tiktok .tt-cyan  { color: var(--tiktok-cyan); transform: translate(calc(-50% - 1.2px), calc(-50% - 1.2px)); }
.tile--tiktok .tt-red   { color: var(--tiktok-red);  transform: translate(calc(-50% + 1.2px), calc(-50% + 1.2px)); }
.tile--tiktok .tt-white { color: #fff;               transform: translate(-50%, -50%); }

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

.label {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.arrow {
  flex: none;
  width: var(--arrow-size);
  height: var(--arrow-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand-brown-deep);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--brand-border);
  transition: transform .22s var(--ease), background-color .22s var(--ease);
}

.arrow svg { width: 15px; height: 15px; display: block; }

.link:hover .arrow {
  transform: translate(2px, -2px);
}

/* WhatsApp — primary: dark brown */
.link--primary {
  min-height: 66px;
  padding: 10px 16px 10px 11px;
  background: var(--brand-espresso);
  border-color: var(--brand-espresso);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(61, 40, 8, .12), 0 8px 18px -10px rgba(61, 40, 8, .55);
}

.link--primary:hover {
  background: var(--brand-espresso-hover);
  border-color: var(--brand-espresso-hover);
  box-shadow: 0 2px 4px rgba(61, 40, 8, .12), 0 12px 24px -12px rgba(61, 40, 8, .6);
}

.link--primary .tile { width: 44px; height: 44px; }
.link--primary .tile svg { width: 26px; height: 26px; }
.link--primary .label { font-size: 16px; }

.link--primary .arrow {
  background: var(--brand-gold);
  color: var(--brand-brown-ink);
  box-shadow: none;
}

/* Website — secondary: soft golden yellow */
.link--secondary {
  background: var(--brand-honey);
  border-color: var(--brand-honey-edge);
  color: var(--brand-brown-ink);
}

.link--secondary:hover {
  background: var(--brand-honey-hover);
  border-color: var(--brand-brown);
}

.link--secondary .tile--web { box-shadow: 0 1px 2px rgba(61, 40, 8, .08); }

.link--secondary .arrow {
  background: var(--brand-brown-ink);
  color: var(--brand-honey);
  box-shadow: none;
}

/* Section divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 2px 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-brown-deep);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--brand-border);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
}

.footer-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-brown-ink);
}

.footer-tagline {
  margin: 1px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brand-brown-deep);
}

.copyright {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6F675C;
}

/* ---------- Entrance animation ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .hero > *,
  .js .links > *,
  .js .footer {
    animation: rise .6s var(--ease) backwards;
  }
  .js .hero > *:nth-child(1) { animation-delay: .02s; }
  .js .hero > *:nth-child(2) { animation-delay: .08s; }
  .js .hero > *:nth-child(3) { animation-delay: .12s; }
  .js .hero > *:nth-child(4) { animation-delay: .14s; }
  .js .hero > *:nth-child(5) { animation-delay: .18s; }
  .js .links > *:nth-child(1) { animation-delay: .24s; }
  .js .links > *:nth-child(2) { animation-delay: .30s; }
  .js .links > *:nth-child(3) { animation-delay: .34s; }
  .js .links > *:nth-child(4) { animation-delay: .38s; }
  .js .links > *:nth-child(5) { animation-delay: .44s; }
  .js .links > *:nth-child(6) { animation-delay: .50s; }
  .js .footer { animation-delay: .58s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
  .link, .arrow { transition: none; }
  .link:hover, .link:hover .arrow { transform: none; }
}

/* ---------- Small & larger screens ---------- */

@media (max-width: 360px) {
  .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .brand { font-size: 24px; }
  .label { font-size: 15px; }
  .link--primary .label { font-size: 15px; }
  .link { gap: 12px; }
}

@media (min-width: 640px) {
  .page { padding-top: 56px; }
  body::before { height: 340px; }
}

/* ---------- 404 page ---------- */
.page--center { justify-content: center; text-align: center; }
.page--center .brand { margin: 0; }
.page--center .welcome { margin: 10px auto 24px; }
.link--center { justify-content: center; min-height: 56px; }
