/* =========================
   KAY FENG — PERSONAL SITE
   Wabi-sabi palette + type
   ========================= */

:root {
  /* Palette from Figma */
  --paper:  #EDE6D6;          /* A3 BACKGROUND — warm cream */
  --paper-deep: #E4DBC7;
  --paper-soft: #F4EFE2;
  --stone:  #8A8278;
  --stone-soft: #B5AC9F;
  --clay:   #A8896C;
  --clay-deep: #8A6F55;
  --ink:    #2A2723;
  --ink-soft: #4A453E;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, monospace;

  --max: 1440px;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  cursor: none;
}

/* Paper grain — subtle, persistent */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(138,130,120,0.04) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(168,137,108,0.05) 0%, transparent 40%),
    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' seed='5'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.15  0 0 0 0 0.13  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px, 200px 200px, 240px 240px;
}

/* Vignette edge — like aged paper */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(42,39,35,0.08) 100%);
}

/* === Custom ink-blot cursor === */
.ink-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.3s;
  filter: blur(0.5px);
}
.ink-cursor.hover {
  width: 56px;
  height: 56px;
  background: var(--ink);
  opacity: 0.18;
}
.ink-cursor.click {
  width: 80px;
  height: 80px;
  opacity: 0.1;
}
.ink-cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

/* === Type system === */
.display {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.serif {
  font-family: var(--serif);
  font-weight: 400;
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}

/* === Reveal on scroll === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* === Section base === */
section {
  position: relative;
  z-index: 2;
  padding: 120px 64px;
}

@media (max-width: 768px) {
  section { padding: 80px 24px; }
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: clamp(24px, 5vw, 64px);
  padding-right: clamp(24px, 5vw, 64px);
}

/* === Top nav === */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(24px, 5vw, 64px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.topnav .name { font-weight: 500; }
.topnav .links {
  display: flex;
  gap: 28px;
  pointer-events: auto;
}
.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}
.topnav a:hover { color: var(--ink); }
.topnav a::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width 0.4s ease;
}
.topnav a:hover::after { width: 100%; }

/* === Buttons / interactive === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: none;
  transition: all 0.4s;
  text-decoration: none;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

/* === Decorative seal / stamp === */
.seal {
  font-family: var(--serif);
  font-style: italic;
  color: var(--clay);
  font-size: 14px;
}

/* === Drag-cursor styles === */
.dragging { cursor: none; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* hide native cursor on links so our custom one rules */
a, button, [role="button"] { cursor: none; }

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: float 4s ease-in-out infinite;
}
.scroll-hint .line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--stone), transparent);
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
