/* Studio M — shared design tokens + base styles, used by every public and admin page.
   Palette/fonts/animation vocabulary carried over unchanged from the original build's
   tailwind.config.ts so nothing about the brand look changes in this rewrite. */

:root {
  --ivory: #FAF7F2;
  --cream: #F3EDE4;
  --sand: #E8DFD1;
  --taupe: #C9BEAC;
  --charcoal: #2B2825;
  --graphite: #54504A;
  --champagne: #C9A876;
  --champagne-dark: #A9875A;
  --rose: #C79A93;

  --ink-veil: rgba(43, 40, 37, 0.55);
  --ink-veil-soft: rgba(43, 40, 37, 0.28);
  --hairline: rgba(43, 40, 37, 0.09);
  --hairline-on-dark: rgba(250, 247, 242, 0.12);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 22px;

  --shadow-card: 0 2px 20px rgba(43, 40, 37, 0.06);
  --shadow-lifted: 0 8px 40px rgba(43, 40, 37, 0.10);
  --shadow-cinematic: 0 30px 80px -20px rgba(43, 40, 37, 0.35);

  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-slow: 0.9s;
  --dur-med: 0.4s;

  /* "Glass Skin" motif — a cool light/refraction accent layered onto the warm palette,
     used only for the cursor glow, shimmer sweeps, and frosted-glass surfaces below.
     Named after the signature Korean Glass Skin Facial, not a generic accent color. */
  --glass-glow: rgba(255, 255, 255, 0.9);
  --glass-glow-soft: rgba(255, 255, 255, 0.4);
  --glass-tint: rgba(255, 255, 255, 0.14);

  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --max-content: 1200px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  animation: pageLoadIn 0.5s ease;
}
@media (min-width: 640px) {
  body { padding-bottom: 0; }
}
/* Page-load transition — pure CSS, no JS dependency, so content is never hidden from a
   crawler or a visitor with JS disabled; it simply fades/rises in on its own regardless.
   Deliberately NOT using fill-mode forwards/both: a CSS animation holding a `transform`
   value (even the identity result of animating *to* `transform: none`) keeps the element
   promoted to a containing block for position:fixed descendants for as long as the fill-mode
   holds it — that broke the mobile dock/FAB/cursor-glow site-wide (they went fixed-to-body
   instead of fixed-to-viewport). With no fill-mode, the animation plays once and then the
   element reverts to its normal cascaded style (no transform at all), which is identical to
   the "to" keyframe visually, so there's no discontinuity — just no lingering transform. */
@keyframes pageLoadIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.018em;
  margin: 0 0 0.5em;
  color: var(--charcoal);
}
h1 { font-size: clamp(2.3rem, 4.6vw, 3.75rem); }
h2 { font-size: clamp(1.7rem, 2.9vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; color: var(--graphite); }

/* --- Ambient glow — the sitewide signature motif: slow-drifting soft light,
   used behind the hero, dark sections, and the closing CTA to tie the page
   into one continuous atmosphere instead of stacked blocks. Purely decorative. */
.atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.atmosphere-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
  animation: glowDrift 22s ease-in-out infinite;
}
.atmosphere-orb.champagne { background: rgba(201, 168, 118, 0.30); }
.atmosphere-orb.rose { background: rgba(199, 154, 147, 0.22); animation-delay: -9s; animation-duration: 26s; }
@media (prefers-reduced-motion: reduce) {
  .atmosphere-orb { animation: none; }
}

/* --- Section bridges — a soft gradient veil that overlaps the seam between two
   sections so they read as one continuous surface rather than a hard block edge. */
.section-bridge { position: relative; z-index: 1; }
.bridge-to-dark::after,
.bridge-to-light::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 120px;
  pointer-events: none;
}
.bridge-to-dark::after { background: linear-gradient(to bottom, transparent, var(--charcoal)); }
.bridge-to-light::after { background: linear-gradient(to bottom, transparent, var(--ivory)); }

.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--champagne-dark);
}

/* --- Buttons --- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--charcoal);
  color: var(--ivory);
}
.btn-primary:hover { background: #1c1a17; box-shadow: var(--shadow-lifted); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--sand);
}
.btn-secondary:hover { border-color: var(--champagne-dark); background: var(--cream); }

/* --- Cards --- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--cream);
  color: var(--champagne-dark);
}

/* --- Forms (shared by public contact form + admin CRUD forms) --- */
label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--graphite);
}
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--charcoal);
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--champagne);
  outline-offset: 1px;
  border-color: var(--champagne-dark);
}
textarea { resize: vertical; min-height: 110px; }
.field-hint { font-weight: 400; font-size: 0.78rem; color: var(--graphite); opacity: 0.75; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; margin: 0; }
.checkbox-row label { margin: 0; }

/* --- Scroll-reveal utility (used by homepage cinematic sections) --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-med) var(--ease-luxury), transform var(--dur-med) var(--ease-luxury);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Soft masked reveal — a clip-path curtain lift, for imagery entering the viewport.
   The clip-path lives on the child, not the observed element itself: clipping the target
   that IntersectionObserver watches collapses its intersection ratio to 0, so the reveal
   could never fire (browsers compute intersection against the clipped, not layout, box). */
.reveal-mask > * {
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  transition: clip-path 0.65s var(--ease-luxury), opacity 0.4s ease;
}
.reveal-mask.revealed > * {
  clip-path: inset(0 0 0% 0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-mask > * { opacity: 1; transform: none; clip-path: none; transition: none; }
  html { scroll-behavior: auto; }
  .atmosphere-orb, .hero-slide img, .showcase-media img, .journey-frame img { animation: none !important; }
}

/* --- "Glass Skin" light motif: ambient cursor glow + shimmer sweeps ---
   Desktop/fine-pointer only, and off entirely under reduced-motion — this is atmosphere,
   never a load-bearing interaction. */
.glow-cursor {
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glass-glow) 0%, var(--glass-glow-soft) 45%, transparent 72%);
  mix-blend-mode: soft-light;
  pointer-events: none;
  opacity: 0;
  transform: translate(-100px, -100px) scale(1);
  transition: opacity 0.3s ease, transform 0.12s linear, width 0.25s var(--ease-luxury), height 0.25s var(--ease-luxury), margin 0.25s var(--ease-luxury);
}
.glow-cursor.is-active { opacity: 1; }
.glow-cursor.is-hovering { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .glow-cursor { display: none; }
}

/* A single diagonal light sweep, like light catching the edge of glass. Trigger by adding
   .shimmer-play (JS, on load / on hover) — not a CSS-only :hover so it can be sequenced. */
.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, var(--glass-tint) 48%, var(--glass-glow-soft) 50%, var(--glass-tint) 52%, transparent 60%);
  transform: translateX(-120%);
  pointer-events: none;
}
.shimmer.shimmer-play::after {
  animation: shimmerSweep 1.1s var(--ease-soft) 1;
}
@keyframes shimmerSweep {
  to { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .shimmer.shimmer-play::after { animation: none; }
}

/* Frosted-glass surface — the material language behind the header-on-scroll, the FAB, and
   active chip/overlay states. */
.glass-surface {
  background: rgba(250, 247, 242, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.glass-surface-dark {
  background: rgba(43, 40, 37, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* --- Keyframes carried over from tailwind.config.ts animation vocabulary --- */
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes brandPulse {
  0%, 100% { box-shadow: var(--shadow-lifted), 0 0 0 0 rgba(201, 168, 118, 0.35); }
  50% { box-shadow: var(--shadow-lifted), 0 0 0 10px rgba(201, 168, 118, 0); }
}
@keyframes glowDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2%, -3%) scale(1.05); }
}
@keyframes heroKenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1%, -1%); }
}
@keyframes streamScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes streamScrollReverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.fade-up { animation: fadeUp 0.6s ease-out both; }

/* --- AI-generated image overlay (reusable, toggleable — see render_image() helper) --- */
.ai-overlay-wrap { position: relative; overflow: hidden; }
.ai-overlay-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: rgba(43, 40, 37, 0.42);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (max-width: 860px) {
  .container { padding: 0 18px; }
}
