/* ЗаконГПТ — Luxury Light Design System */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Warm cream paper palette */
  --bg-base:        #F4EFE6;   /* main warm cream */
  --bg-paper:       #FAF7F0;   /* lighter paper */
  --bg-elevated:    #FFFDF8;   /* card surface */
  --bg-deep:        #EBE4D6;   /* deeper section */
  --bg-ink:         #15222B;   /* brand ink (from favicon) */

  /* Ink text */
  --ink:            #15222B;
  --ink-soft:       #2A3744;
  --ink-mute:       #6B6258;
  --ink-faint:      #9A9286;
  --ink-on-dark:    #F4EFE6;

  /* Bronze gold accent */
  --gold:           #9C7A3C;       /* deep antique */
  --gold-warm:      #B89668;       /* polished bronze */
  --gold-light:     #D9BE8A;       /* champagne */
  --gold-soft:      rgba(156, 122, 60, 0.10);
  --gold-line:      rgba(156, 122, 60, 0.32);

  /* Lines */
  --line:           rgba(20, 17, 12, 0.10);
  --line-soft:      rgba(20, 17, 12, 0.06);
  --line-strong:    rgba(20, 17, 12, 0.20);

  /* Semantic */
  --risk:           #A33B22;
  --success:        #2D6A3E;

  --ease:           cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-base);
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body { overflow-x: clip; }

body {
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

::selection { background: var(--gold-warm); color: var(--bg-paper); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.serif {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-feature-settings: "lnum", "ss01";
  letter-spacing: -0.015em;
  font-weight: 500;
}

.mono { font-family: 'JetBrains Mono', monospace; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.hairline {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* Buttons — glassmorphic pill: bg drains top→down, underline draws, quill reveals */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 54px;
  padding: 0 30px;
  border-radius: 999px;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background-color: transparent;
  transition: color 360ms var(--ease), transform 360ms var(--ease);
  isolation: isolate;
  overflow: visible;
}

/* The fill plate — glassmorphic, drains top→down on hover */
.btn-fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  clip-path: inset(0 0 0 0 round 999px);
  transition: clip-path 380ms cubic-bezier(0.7, 0, 0.3, 1);
  pointer-events: none;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
}
.btn:hover .btn-fill { clip-path: inset(100% 0 0 0 round 999px); }

/* Bottom underline — draws left→right after fill is gone */
.btn-underline {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 460ms cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: 0ms;
  z-index: 2;
  box-shadow: 0 0 8px rgba(217, 190, 138, 0.65);
  pointer-events: none;
}
.btn:hover .btn-underline {
  transform: scaleX(1);
  transition-delay: 320ms;
}

/* Quill — anchored at right end of underline, reveals via diagonal mask */
.btn-quill {
  position: absolute;
  right: 4%;
  bottom: -10px;
  width: 32px;
  height: 30px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transform: translate(-3px, 2px) rotate(-6deg);
  transition: opacity 200ms ease, transform 320ms cubic-bezier(0.65, 0, 0.35, 1);
  -webkit-mask-image: linear-gradient(45deg, #000 0%, #000 var(--mask-pos, 0%), transparent var(--mask-pos, 0%));
          mask-image: linear-gradient(45deg, #000 0%, #000 var(--mask-pos, 0%), transparent var(--mask-pos, 0%));
}
.btn:hover .btn-quill {
  opacity: 1;
  transform: translate(0, 0) rotate(0deg);
  transition-delay: 720ms;
  animation: btn-quill-draw 380ms cubic-bezier(0.5, 0, 0.25, 1) 720ms forwards;
}
@keyframes btn-quill-draw {
  0%   { --mask-pos: 0%; }
  100% { --mask-pos: 115%; }
}
@property --mask-pos {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
.btn-quill svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(21, 34, 43, 0.25));
}

/* Primary — glassmorphic dark ink, no border */
.btn-primary { color: #F0E6D0; }
.btn-primary .btn-fill {
  background:
    linear-gradient(180deg, rgba(40, 58, 70, 0.92) 0%, rgba(21, 34, 43, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 14px 32px -14px rgba(21, 34, 43, 0.55),
    0 4px 12px -6px rgba(21, 34, 43, 0.3);
}
.btn-primary:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-primary .btn-quill svg path { fill: var(--gold); }

/* Ghost — frosted paper pill */
.btn-ghost { color: var(--ink); }
.btn-ghost .btn-fill {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.72) 0%, rgba(245, 240, 228, 0.55) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(21, 34, 43, 0.1),
    0 6px 18px -10px rgba(21, 34, 43, 0.18);
}
.btn-ghost:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-ghost .btn-quill svg path { fill: var(--ink); }

/* Gold — accent glassy CTA */
.btn-gold { color: var(--ink); }
.btn-gold .btn-fill {
  background: linear-gradient(180deg, rgba(232, 207, 153, 0.96) 0%, rgba(193, 158, 90, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.6),
    inset 0 -1px 0 rgba(120, 90, 40, 0.25),
    0 14px 32px -14px rgba(156, 122, 60, 0.6);
}
.btn-gold:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-gold .btn-quill svg path { fill: var(--ink); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn-fill, .btn-underline, .btn-quill { transition: none !important; animation: none !important; }
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Subtle paper grain */
.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0 0.05 0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
