/* ==========================================================================
   THE PRIVATE OFFICE — DESIGN SYSTEM
   base.css — reset · document · typography · utilities
   ========================================================================== */

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--space-3);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--gold-300); color: var(--navy-900); }

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Quiet, considered scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(13, 27, 46, 0.18);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(198, 161, 91, 0.55); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: rgba(247, 242, 232, 0.16); }

/* ------------------------------------------------------------- typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); } h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); } h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); } h6 { font-size: var(--fs-h6); }
p { max-width: 68ch; }

.display-1 {
  font-family: var(--font-display);
  font-size: var(--fs-display-1);
  font-weight: var(--fw-medium);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
}
.display-2 {
  font-family: var(--font-display);
  font-size: var(--fs-display-2);
  font-weight: var(--fw-medium);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
}

/* Ceremonial label — Cinzel, letterspaced, always uppercase */
.eyebrow {
  font-family: var(--font-sub);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--track-ceremony);
  text-transform: uppercase;
  color: var(--accent-ink);
  line-height: var(--lh-ui);
}
.eyebrow--mute { color: var(--ink-mute); }
.eyebrow--emerald { color: var(--presence); }

.lede {
  font-family: var(--font-display);
  font-size: var(--fs-h5);
  font-weight: var(--fw-regular);
  line-height: 1.55;
  color: var(--ink-soft);
}

.small { font-size: var(--fs-sm); line-height: 1.65; }
.caption {
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--ink-mute);
  letter-spacing: var(--track-wide);
}
.mono { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.01em; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.gold-text {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -------------------------------------------------------------- utilities */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--margin-x);
}

[data-theme="dark"] { background: var(--surface); color: var(--ink); }

.hairline { border: 0; border-top: 1px solid var(--line); }
.hairline-gold { border: 0; height: 1px; background: var(--grad-gold-line); }

/* Ornamental divider — hairline · diamond · hairline */
.rule-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--gold-500);
}
.rule-ornament::before,
.rule-ornament::after {
  content: "";
  height: 1px;
  flex: 1 1 0%;
  max-width: 120px;
  background: var(--grad-gold-line);
}
.rule-ornament::after { transform: scaleX(-1); }
.rule-ornament .diamond {
  width: 7px; height: 7px;
  background: var(--gold-500);
  transform: rotate(45deg);
  flex: none;
}

/* UAE-inspired geometric lattice — whisper-quiet background */
.pattern-lattice {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23C6A15B' stroke-opacity='0.10'%3E%3Cpath d='M48 6 54 42 90 48 54 54 48 90 42 54 6 48 42 42Z'/%3E%3Ccircle cx='48' cy='48' r='14'/%3E%3Cpath d='M33 33 63 63M63 33 33 63'/%3E%3C/g%3E%3Cg fill='%23C6A15B' fill-opacity='0.10'%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='96' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='96' r='1.6'/%3E%3Ccircle cx='96' cy='96' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}
.pattern-lattice--light {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%230D1B2E' stroke-opacity='0.055'%3E%3Cpath d='M48 6 54 42 90 48 54 54 48 90 42 54 6 48 42 42Z'/%3E%3Ccircle cx='48' cy='48' r='14'/%3E%3Cpath d='M33 33 63 63M63 33 33 63'/%3E%3C/g%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ icons */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--16 { width: 16px; height: 16px; }
.icon--20 { width: 20px; height: 20px; }
.icon--28 { width: 28px; height: 28px; }
.icon--32 { width: 32px; height: 32px; }

.emblem { color: var(--gold-500); flex: none; }

/* ------------------------------------------------------------ text links */
.link {
  position: relative;
  color: var(--accent-ink);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-standard);
}
.link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
  transform-origin: right;
  transform: scaleX(1);
  transition: transform var(--dur-3) var(--ease-lux), opacity var(--dur-2);
}
.link:hover { color: var(--gold-600); }
.link:hover::after { transform: scaleX(0.35); opacity: 1; }
[data-theme="dark"] .link:hover { color: var(--gold-300); }

/* Arrow link — reading trails */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sub);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--accent-ink);
  text-decoration: none;
}
.link-arrow .icon { width: 15px; height: 15px; transition: transform var(--dur-3) var(--ease-lux); }
.link-arrow:hover { color: var(--gold-600); }
.link-arrow:hover .icon { transform: translateX(5px); }
[data-theme="dark"] .link-arrow:hover { color: var(--gold-300); }

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-sub);
  font-size: 0.625rem;
  font-weight: var(--fw-semi);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--surface-raised);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: var(--r-circle); background: currentColor; }
.pill--gold    { color: var(--gold-700); border-color: rgba(198,161,91,.45); background: var(--gold-50); }
.pill--emerald { color: var(--emerald-600); border-color: var(--presence-line); background: var(--presence-wash); }
.pill--navy    { color: var(--navy-500); border-color: rgba(42,74,112,.28); background: var(--navy-50); }
[data-theme="dark"] .pill--gold    { color: var(--gold-300); background: rgba(198,161,91,.10); }
[data-theme="dark"] .pill--emerald { color: var(--emerald-300); background: rgba(23,121,95,.12); }
[data-theme="dark"] .pill--navy    { color: var(--navy-200); background: rgba(95,130,175,.10); }

/* -------------------------------------------------------------- motion kit */
@keyframes po-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes po-fade {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes po-spin { to { transform: rotate(360deg); } }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-4) var(--ease-lux) var(--d, 0ms),
    transform var(--dur-4) var(--ease-lux) var(--d, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

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