/* Karma Designs — shared site styles
   Ported from the Claude Design prototype into a standalone website.
   Palette: sand #EFE6D4 / ink #2B1D12 / terracotta #B14A26 / rust #8E3B22 / gold #F0C489 */

:root {
  --kd-sand: #EFE6D4;
  --kd-cream: #FFF4E4;
  --kd-ink: #2B1D12;
  --kd-terracotta: #B14A26;
  --kd-rust: #8E3B22;
  --kd-gold: #F0C489;
  --kd-green: #1F6B4A;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  /* body sans rides the system stack — one less webfont on slow connections */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  /* kinetic type — scene.js maps these to scroll progress */
  --kd-type-wght: 500;
  --kd-type-track: 0em;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--kd-sand);
  color: var(--kd-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #C4562F; color: var(--kd-cream); }

a { color: inherit; }

/* ---- CSS grain — breaks up flat digital color fields ---- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- animations ---- */
@keyframes kdPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .35; } }
@keyframes kdBob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes kdLine  { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- nav ---- */
.kd-nav { flex-wrap: wrap; row-gap: 10px; }
.kd-nav > div { margin-left: auto; }

.kd-nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--kd-ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(43, 29, 18, .35);
  padding-bottom: 2px;
  transition: color .25s ease, border-color .25s ease;
}
.kd-nav-link:hover { color: var(--kd-rust); border-bottom-color: var(--kd-rust); }

.kd-btn-primary {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--kd-cream);
  background: var(--kd-terracotta);
  border: 1px solid var(--kd-terracotta);
  padding: 11px 18px;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: background .25s ease, border-color .25s ease;
}
.kd-btn-primary:hover { background: var(--kd-rust); border-color: var(--kd-rust); }

/* narrow viewports: shrink nav type so the booking CTA never clips */
@media (max-width: 480px) {
  .kd-nav-link { font-size: 10px; }
  .kd-btn-primary { font-size: 10px; padding: 9px 12px; letter-spacing: .04em; }
}

/* CTA buttons (final panel + portfolio footer) */
.kd-cta-gold, .kd-cta-ghost {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 15px 26px;
  border-radius: 0;
  text-decoration: none;
  transition: background .25s ease, border-color .25s ease;
}
.kd-cta-gold { color: var(--kd-ink); background: var(--kd-gold); border: 1px solid var(--kd-gold); }
.kd-cta-gold:hover { background: var(--kd-cream); border-color: var(--kd-cream); }
.kd-cta-ghost { color: var(--kd-cream); border: 1px solid rgba(255, 244, 228, .55); }
.kd-cta-ghost:hover { border-color: var(--kd-cream); background: rgba(255, 244, 228, .1); }

/* progress rail dots — 9px visual, ~41px touch target via ::after */
.kd-rail-dot {
  width: 9px; height: 9px;
  border-radius: 0;
  border: 1px solid rgba(43, 29, 18, .45);
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background .2s ease;
}
.kd-rail-dot::after { content: ""; position: absolute; inset: -16px; }
.kd-rail-dot:hover, .kd-rail-dot[aria-current="true"] { background: var(--kd-rust); }

/* ---- portfolio grid ---- */
.kd-project { display: flex; flex-direction: column; gap: 14px; margin: 0; }

/* Placeholder frame — swap for <img class="kd-frame"> to use a real photo. */
.kd-frame {
  width: 100%;
  height: 320px;
  display: block;
  border-radius: 0;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255, 244, 228, .5), transparent 60%),
    linear-gradient(160deg, #E4D2B0 0%, #C7A46F 55%, #A84D2B 140%);
  border: 1px solid rgba(43, 29, 18, .25);
  position: relative;
  overflow: hidden;
  transition: border-color .35s ease;
}
.kd-frame::after {
  /* faint haveli watermark, matches the favicon motif */
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M6 26 L6 15 L16 7 L26 15 L26 26 Z' fill='none' stroke='%232B1D12' stroke-width='1.2'/%3E%3Crect x='13' y='18' width='6' height='8' fill='%232B1D12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 92px 92px;
  opacity: .16;
}
/* grounded, not floating: hover reads as a border state, not a lift */
.kd-project:hover .kd-frame { border-color: var(--kd-ink); }

.kd-caption { display: flex; align-items: baseline; gap: 12px; }
.kd-num { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; color: var(--kd-rust); }
.kd-meta { display: flex; flex-direction: column; gap: 4px; }
.kd-title { font-family: var(--font-serif); font-size: 26px; color: var(--kd-ink); line-height: 1.1; }
.kd-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: rgba(43, 29, 18, .6); }

.kd-noscript {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--kd-sand); text-align: center; padding: 32px;
  font-family: var(--font-sans); font-size: 15px; color: var(--kd-ink);
}

/* ---- scroll narrative captions (kd-cap) ----
   Scrim keeps copy legible regardless of what the camera puts behind it. */
.kd-cap {
  position: fixed;
  left: 5vw;
  bottom: 12vh;
  z-index: 10;
  max-width: min(470px, 82vw);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity, clip-path;
  padding: 18px 22px;
  background: rgba(239, 230, 212, .58);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  border: 1px solid rgba(43, 29, 18, .18);
}
.kd-cap-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--kd-type-wght);
  letter-spacing: calc(.2em + var(--kd-type-track));
  color: var(--kd-rust);
}
.kd-cap-line {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: var(--kd-type-wght);
  line-height: 1.12;
  color: var(--kd-ink);
  margin-top: 10px;
}

/* ---- ground-emergence reveals (final CTA) ---- */
.kd-rise {
  display: block;
  opacity: 0;
  transform: translateY(34px);
  clip-path: inset(0 0 42% 0);
  transition:
    transform 1.05s cubic-bezier(.16, 1, .3, 1),
    clip-path 1.05s cubic-bezier(.16, 1, .3, 1),
    opacity .9s ease;
}
#kd-cta.kd-show .kd-rise { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
#kd-cta.kd-show .kd-d2 { transition-delay: .16s; }
#kd-cta.kd-show .kd-d3 { transition-delay: .34s; }
#kd-cta.kd-show .kd-d4 { transition-delay: .52s; }

/* ---- page handshake (Experience <-> Portfolio) ---- */
@keyframes kdPageIn { from { opacity: 0; } to { opacity: 1; } }
body.kd-page-in { animation: kdPageIn .65s ease both; }
body.kd-page-out { opacity: 0; transition: opacity .42s ease; }

@media (prefers-reduced-motion: reduce) {
  .kd-rise { transition: none; }
  body.kd-page-in { animation: none; }
  body.kd-page-out { transition: none; }
}
