/* ============================================================
   Bloomify AI — global.css
   Design tokens, reset, typography, shared components.
   Palette (diluluskan): lavender #CDB4DB · sage #B8D8BA
   soft pink #F5CDD5 · cream #FFF8ED · deep plum #40384C
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* palet teras */
  --lavender: #cdb4db;
  --sage: #b8d8ba;
  --pink: #f5cdd5;
  --cream: #fff8ed;
  --plum: #40384c;

  /* turunan */
  --lavender-soft: #e4d6ec;
  --lavender-deep: #9d7cb4;
  --sage-soft: #d7e8d8;
  --sage-deep: #6f9374;
  --pink-soft: #fbe6ea;
  --pink-deep: #dfa3b4;
  --cream-deep: #f6ecdb;
  --ink: #2b2433;

  /* teks & garisan */
  --text: var(--plum);
  --text-soft: rgba(64, 56, 76, 0.80);
  --text-faint: rgba(64, 56, 76, 0.60);
  --hairline: rgba(64, 56, 76, 0.16);
  --hairline-soft: rgba(64, 56, 76, 0.09);
  --on-dark: #fdf6ea;
  --on-dark-soft: rgba(253, 246, 234, 0.66);

  /* tipografi */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia,
    "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* saiz skala (fluid) */
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.18vw, 1.03rem);
  --step-1: clamp(1.1rem, 1.03rem + 0.35vw, 1.28rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.8vw, 1.9rem);
  --step-3: clamp(2rem, 1.6rem + 1.9vw, 3.1rem);
  --step-4: clamp(2.7rem, 1.9rem + 4vw, 5.1rem);

  /* jarak */
  --space-2xs: 0.35rem;
  --space-xs: 0.6rem;
  --space-s: 1rem;
  --space-m: 1.6rem;
  --space-l: 2.2rem;
  --space-xl: 3.2rem;
  --space-2xl: clamp(3rem, 5.6vw, 6rem);

  /* bentuk */
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 26px;
  --radius-arch: 999px 999px 18px 18px;
  --shell: min(1240px, 100% - 2.6rem);

  /* gerakan */
  --ease-out: cubic-bezier(0.22, 0.68, 0.28, 1);
  --dur: 700ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ul,
ol,
dl {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Base ---------- */
body {
  min-height: 100vh;
  background-color: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* tekstur kertas halus — mengelak latar rata "template" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
  background-image: radial-gradient(
      circle at 16% 10%,
      rgba(205, 180, 219, 0.42),
      transparent 44%
    ),
    radial-gradient(circle at 90% 74%, rgba(184, 216, 186, 0.46), transparent 46%),
    radial-gradient(circle at 58% 2%, rgba(245, 205, 213, 0.34), transparent 40%),
    radial-gradient(circle at 6% 88%, rgba(184, 216, 186, 0.30), transparent 38%);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.012em;
  color: var(--plum);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
  line-height: 1.14;
}
h4 {
  font-size: var(--step-1);
  line-height: 1.24;
}

p {
  text-wrap: pretty;
}

em,
.italic {
  font-style: italic;
  color: var(--lavender-deep);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.62;
  color: var(--text-soft);
  max-width: 44ch;
}

/* ---------- Layout ---------- */
.container {
  width: var(--shell);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.section {
  padding-block: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.section--tight {
  padding-block: var(--space-xl);
}

.section-head {
  display: grid;
  gap: var(--space-s);
  max-width: 52ch;
  margin-bottom: var(--space-l);
}

.section-head p {
  color: var(--text-soft);
  max-width: 48ch;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--plum);
  --btn-fg: var(--on-dark);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1;
  transition: transform 0.35s var(--ease-out), background-color 0.35s var(--ease-out),
    color 0.35s var(--ease-out), border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn__arrow {
  transition: transform 0.35s var(--ease-out);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

.btn--primary:hover {
  background: var(--ink);
  box-shadow: 0 14px 30px -18px rgba(43, 36, 51, 0.7);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--plum);
  --btn-border: var(--hairline);
}

.btn--ghost:hover {
  --btn-bg: rgba(255, 248, 237, 0.7);
  --btn-border: rgba(64, 56, 76, 0.34);
}

.btn--light {
  --btn-bg: var(--cream);
  --btn-fg: var(--plum);
}

.btn--light:hover {
  --btn-bg: #fff;
  box-shadow: 0 16px 34px -20px rgba(0, 0, 0, 0.55);
}

.btn--sm {
  padding: 0.72rem 1.25rem;
  font-size: 0.7rem;
}

/* pautan teks dengan garis bawah halus */
.link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.2rem;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.link-quiet:hover {
  color: var(--plum);
  border-color: var(--plum);
}

/* ---------- Tag / badge ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  white-space: nowrap;
}

.tag--sample {
  border-color: rgba(157, 124, 180, 0.4);
  background: rgba(205, 180, 219, 0.22);
  color: #6d5182;
}

.tag--plain {
  border-color: var(--hairline-soft);
  background: transparent;
}

/* ---------- Divider ornamen ---------- */
.ornament {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-faint);
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Focus & aksesibiliti ---------- */
:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-dark :focus-visible {
  outline-color: var(--cream);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.8rem 1.2rem;
  background: var(--plum);
  color: var(--on-dark);
  border-radius: var(--radius-s);
  font-size: var(--step--1);
  transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
}

.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;
}

/* ---------- Toast status ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 90;
  width: min(30rem, calc(100% - 2rem));
  transform: translate(-50%, 1.5rem);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-m);
  background: var(--plum);
  color: var(--on-dark);
  font-size: var(--step--1);
  line-height: 1.55;
  box-shadow: 0 24px 50px -24px rgba(43, 36, 51, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out),
    visibility 0.4s;
}

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

.toast strong {
  display: block;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
