/* =========================================================
   RS PRIMA PEKANBARU — LINKTREE
   Brand: brown #6F5742 · cream #D6D2C7 · white #FFFFFF
   Type: Lora (display) + Poppins (UI/body)
   ========================================================= */

:root {
  --brown: #6f5742;
  --brown-deep: #5b4635;
  --cream: #d6d2c7;
  --white: #ffffff;
  --page: #d6d2c7;
  --line: rgba(214, 210, 199, 0.72);
  --shadow: 0 30px 80px rgba(60, 44, 32, 0.22);
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", "Segoe UI", Tahoma, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--brown);
  background:
    radial-gradient(circle at 16% 10%, #e4e0d6 0, rgba(228, 224, 214, 0) 42%),
    radial-gradient(circle at 84% 90%, #cfcabe 0, rgba(207, 202, 190, 0) 48%),
    var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: var(--brown);
  color: var(--white);
}

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

/* ================= DESKTOP SHELL ================= */

.page {
    background: transparent !important;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  width: min(1160px, 100%);
  height: min(860px, calc(100vh - 48px));
  min-height: 760px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--white);
  box-shadow: var(--shadow);
  isolation: isolate;
}

/* ================= BRAND PANEL ================= */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 52px 56px 44px;
  overflow: hidden;
  background: var(--brown);
  color: var(--cream);
}

.rings {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.rings span {
  position: absolute;
  display: block;
  border: 1px solid rgba(214, 210, 199, 0.13);
  border-radius: 50%;
}

.rings span:nth-child(1) {
  width: 560px;
  height: 560px;
  top: -230px;
  right: -220px;
}

.rings span:nth-child(2) {
  width: 380px;
  height: 380px;
  top: -140px;
  right: -130px;
  border-color: rgba(214, 210, 199, 0.1);
}

.rings span:nth-child(3) {
  width: 220px;
  height: 220px;
  top: -60px;
  right: -50px;
  border-color: rgba(214, 210, 199, 0.08);
}

.logo {
  position: relative;
  z-index: 2;
  display: block;
  width: 190px;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.48))
    drop-shadow(0 0 20px rgba(225, 183, 120, 0.36));
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.38))
      drop-shadow(0 0 14px rgba(225, 183, 120, 0.24));
  }
  to {
    filter: drop-shadow(0 0 11px rgba(255, 255, 255, 0.62))
      drop-shadow(0 0 26px rgba(225, 183, 120, 0.48));
  }
}

.brand-copy {
  position: relative;
  z-index: 2;
  margin: auto 0;
  padding: 36px 0;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--white);
}

h1 span {
  display: block;
}

.tagline {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(214, 210, 199, 0.86);
}

.brand-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: rgba(214, 210, 199, 0.62);
}

.brand-meta p {
  margin: 0;
}

.meta-line {
  display: block;
  flex: none;
  width: 26px;
  height: 1px;
  margin-top: 9px;
  background: rgba(214, 210, 199, 0.35);
}

.ekg {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 78px;
  color: rgba(214, 210, 199, 0.1);
  pointer-events: none;
}

/* ================= LINKS PANEL ================= */

.links {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
  background: var(--white);
}

.links-inner {
  width: 100%;
  max-width: 520px;
}

.links-head {
  margin-bottom: 30px;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--brown);
}

.lede {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(111, 87, 66, 0.66);
}

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

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  color: var(--brown);
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 18px rgba(111, 87, 66, 0.05);
  transition:
    background-color 0.28s ease,
    border-color 0.28s ease,
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.link-card:active {
  transform: scale(0.995);
}

.icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(214, 210, 199, 0.45);
  color: var(--brown);
  transition:
    background-color 0.28s ease,
    color 0.28s ease;
}

.icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.link-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.link-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--brown);
  transition: color 0.28s ease;
}

.link-sub {
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(111, 87, 66, 0.55);
  transition: color 0.28s ease;
}

.arrow {
  display: grid;
  place-items: center;
  color: rgba(111, 87, 66, 0.38);
  transition:
    color 0.28s ease,
    transform 0.28s ease;
}

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

.link-card:focus-visible {
  outline: 3px solid rgba(111, 87, 66, 0.32);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .link-card:hover {
    border-color: var(--brown);
    background: var(--brown);
    box-shadow: 0 16px 32px rgba(111, 87, 66, 0.18);
    transform: translateY(-2px);
  }

  .link-card:hover .link-title {
    color: var(--white);
  }

  .link-card:hover .link-sub {
    color: rgba(214, 210, 199, 0.72);
  }

  .link-card:hover .icon {
    background: rgba(255, 255, 255, 0.12);
    color: var(--cream);
  }

  .link-card:hover .arrow {
    color: var(--cream);
    transform: translateX(3px);
  }
}

.links-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(214, 210, 199, 0.55);
  font-size: 10.5px;
  color: rgba(111, 87, 66, 0.5);
}

.links-foot p {
  margin: 0;
}

.whatsapp-modal {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(111, 87, 66, 0.16);
  border-radius: 22px;
  color: var(--brown);
  box-shadow: 0 24px 70px rgba(60, 44, 32, 0.3);
}

.whatsapp-modal::backdrop {
  background: rgba(36, 29, 23, 0.58);
  backdrop-filter: blur(3px);
}

.whatsapp-modal h2 {
  font-size: 24px;
}

.whatsapp-modal p {
  margin: 12px 0 24px;
  color: rgba(111, 87, 66, 0.75);
  font-size: 14px;
  line-height: 1.6;
}

.whatsapp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.whatsapp-modal-actions form {
  margin: 0;
}

.whatsapp-modal-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--brown);
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.whatsapp-modal-cancel {
  background: var(--white);
  color: var(--brown);
}

.whatsapp-modal-continue {
  background: var(--brown);
  color: var(--white);
}

.whatsapp-modal-button:focus-visible {
  outline: 3px solid rgba(111, 87, 66, 0.32);
  outline-offset: 3px;
}

.foot-tagline {
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  color: rgba(111, 87, 66, 0.58);
}

/* ================= REVEAL ================= */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.is-ready .brand {
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

body.is-ready .links-head {
  animation: rise 0.8s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

body.is-ready .link-card {
  animation: rise 0.7s calc(0.16s + var(--i, 0) * 0.07s) cubic-bezier(0.2, 0.7, 0.2, 1)
    backwards;
}

body.is-ready .links-foot {
  animation: rise 0.8s 0.48s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* ================= TOAST ================= */

.toast {
  position: fixed;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--brown);
  box-shadow: 0 12px 30px rgba(60, 44, 32, 0.28);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= MID DESKTOP ================= */

@media (min-width: 961px) and (max-width: 1100px) {
  .brand {
    padding: 44px 44px 36px;
  }

  .links {
    padding: 44px 44px;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 32px;
  }
}

/* ================= PHONE / TABLET ================= */

@media (max-width: 960px) {
  body {
    background: var(--brown);
  }

  .page {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .brand {
    flex: 0 0 auto;
    min-height: 268px;
    align-items: center;
    padding: 22px 24px 40px;
    text-align: center;
  }

  .logo {
    width: 144px;
  }

  .brand-copy {
    margin: 20px 0 0;
    padding: 0;
  }

  h1 {
    font-size: 31px;
    line-height: 1.04;
  }

  .tagline {
    margin-top: 8px;
    font-size: 12px;
  }

  .brand-meta,
  .ekg {
    display: none;
  }

  .rings span:nth-child(1) {
    width: 360px;
    height: 360px;
    top: -160px;
    right: -140px;
  }

  .rings span:nth-child(2) {
    width: 250px;
    height: 250px;
    top: -100px;
    right: -80px;
  }

  .rings span:nth-child(3) {
    display: none;
  }

  .links {
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: -28px;
    padding: 34px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -20px 40px rgba(60, 44, 32, 0.16);
  }

  .links-inner {
    max-width: 520px;
    margin: 0 auto;
  }

  .links-head {
    margin-bottom: 22px;
    text-align: center;
  }

  h2 {
    font-size: 28px;
  }

  .lede {
    margin-top: 5px;
    font-size: 12.5px;
  }

  .link-list {
    gap: 8px;
  }

  .link-card {
    min-height: 62px;
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
  }

  .icon {
    width: 40px;
    height: 40px;
  }

  .icon svg {
    width: 20px;
    height: 20px;
  }

  .link-title {
    font-size: 14px;
  }

  .link-sub {
    font-size: 10.5px;
  }

  .arrow svg {
    width: 16px;
    height: 16px;
  }

  .links-foot {
    flex-direction: column;
    gap: 4px;
    margin-top: 18px;
    padding-top: 12px;
    font-size: 9.5px;
    text-align: center;
  }

  .foot-tagline {
    font-size: 11px;
  }
}

@media (max-width: 359px) {
  .links {
    padding-right: 14px;
    padding-left: 14px;
  }

  .link-card {
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    gap: 10px;
    padding: 11px 12px;
  }

  .icon {
    width: 38px;
    height: 38px;
  }

  .link-title {
    font-size: 13px;
  }
}

/* ================= REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {
  body.is-ready .brand,
  body.is-ready .links-head,
  body.is-ready .link-card,
  body.is-ready .links-foot {
    animation: none;
  }

  .logo {
    animation: none;
  }

  .link-card,
  .icon,
  .link-title,
  .link-sub,
  .arrow,
  .toast {
    transition: none;
  }
}
