/* ============================================================
   ATELIER AM BODENSEE — Andrea Grabe
   Bespoke design tokens + base + section styling
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Warm Atelier palette (default) */
  --paper:        #F4ECE0;
  --paper-deep:   #EBE0D0;
  --paper-card:   #FBF6EE;
  --ink:          #2A2420;
  --ink-soft:     #5B5048;
  --ink-faint:    #8A7E73;
  --terracotta:   #B6614A;
  --terracotta-d: #9A4E3A;
  --sage:         #5B6B52;
  --sage-d:       #44513D;
  --teal:         #3E6B7C;
  --gold:         #C9A24A;
  --line:         rgba(42, 36, 32, 0.14);
  --line-soft:    rgba(42, 36, 32, 0.08);

  /* accent role tokens (remapped by palette tweak) */
  --accent:       var(--terracotta);
  --accent-2:     var(--sage);
  --accent-3:     var(--teal);
  --accent-4:     var(--gold);

  /* type */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body:    "Hanken Grotesk", system-ui, sans-serif;
  --font-script:  "Pinyon Script", "Dancing Script", "Snell Roundhand", "Brush Script MT", cursive;

  /* motion (scaled by animation intensity) */
  --motion: 1;
  --dur-1: calc(0.5s * var(--motion));
  --dur-2: calc(0.9s * var(--motion));
  --dur-3: calc(1.4s * var(--motion));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.45, 0.05, 0.2, 1);

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 72px);

  --grain-url: 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='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  /* torn-paper deckle mask: a rough turbulent bottom edge */
  --deckle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1100' height='34'%3E%3Cdefs%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.018 0.04' numOctaves='3' seed='4' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='26'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='0' y='0' width='1100' height='14' fill='%23000'/%3E%3Crect x='0' y='8' width='1100' height='18' fill='%23000' filter='url(%23r)'/%3E%3C/svg%3E");
}

/* Bodensee (cooler) palette variant */
[data-palette="bodensee"] {
  --paper:        #EBF1F1;
  --paper-deep:   #DEE8E8;
  --paper-card:   #F6FAFA;
  --ink:          #1F2B2E;
  --ink-soft:     #3F5054;
  --ink-faint:    #71868A;
  --terracotta:   #C26B5A;
  --sage:         #6E8B6E;
  --teal:         #3E6B7C;
  --gold:         #C9A24A;
  --line:         rgba(31, 43, 46, 0.14);
  --line-soft:    rgba(31, 43, 46, 0.07);
  --accent:       var(--teal);
  --accent-2:     var(--sage);
  --accent-3:     var(--terracotta);
  --accent-4:     var(--gold);
}

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

html { scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
}
@media (pointer: coarse) { body { cursor: auto; } }

::selection { background: var(--accent); color: var(--paper-card); }

/* ---------- PAPER GRAIN OVERLAY ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9990;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: var(--grain-url);
  background-size: 220px 220px;
}

/* ---------- PAINT-TRAIL CURSOR ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
}
.cursor-dot {
  width: 9px; height: 9px;
  background: var(--accent);
  transition: width .25s, height .25s, background .4s;
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid var(--accent);
  opacity: .55;
  transition: width .3s var(--ease-out), height .3s var(--ease-out), opacity .3s, border-color .4s;
}
.cursor-ring.hover { width: 64px; height: 64px; opacity: .9; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cursor-dot.hover { width: 5px; height: 5px; }
/* on dark sections: switch to a luminous cursor so it stays visible */
.cursor-dot.on-dark { background: var(--paper-card); mix-blend-mode: normal; }
.cursor-ring.on-dark { border-color: var(--paper-card); mix-blend-mode: normal; }
.cursor-ring.on-dark.hover { background: color-mix(in srgb, var(--paper-card) 14%, transparent); }
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* paint blobs left in the trail */
.paint-blob {
  position: fixed; z-index: 9988; pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: multiply;
  filter: url(#goo-soft);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
}

/* ---------- LAYOUT ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
/* Clip decorative watercolor bleed at the section box so it can't create a
   horizontal pan on mobile. iOS Safari ignores overflow-x on html/body when a
   descendant overflows, but honors it on a normal element. overflow-x: clip
   keeps vertical bleed (e.g. the deckle edge) visible. */
section, footer { position: relative; overflow-x: clip; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 34px; height: 1.5px; background: var(--accent);
  display: inline-block; transform-origin: left;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.02; letter-spacing: -0.01em; }

.display-xl { font-size: clamp(56px, 12vw, 168px); }
.display-l  { font-size: clamp(40px, 7vw, 92px); }
.display-m  { font-size: clamp(30px, 4.5vw, 60px); }

.lede { font-size: clamp(18px, 2vw, 23px); line-height: 1.55; color: var(--ink-soft); max-width: 56ch; }
.serif-it { font-style: italic; }

/* ---------- REVEAL UTILITIES ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.reveal[data-rv] { opacity: 1 !important; transform: none !important; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* word-by-word mask reveal */
.word-rise { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word-rise > span { display: inline-block; transform: translateY(110%); transition: transform var(--dur-2) var(--ease-out); }
.word-rise[data-rv] > span { transform: none !important; }

/* brushstroke underline (SVG path drawn on reveal) */
.brush-underline path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.brush-underline[data-rv] path { animation: brush-draw calc(1.1s * var(--motion)) var(--ease-out) forwards; }
@keyframes brush-draw { to { stroke-dashoffset: 0; } }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  letter-spacing: 0.01em;
  padding: 16px 30px; border-radius: 999px;
  border: none; cursor: none;
  display: inline-flex; align-items: center; gap: 10px;
  position: relative; overflow: hidden;
  transition: transform .35s var(--ease-out), box-shadow .35s, color .35s;
}
.btn-primary { background: var(--accent); color: var(--paper-card); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--ink); border-radius: 999px;
  transform: scaleX(0); transform-origin: right; opacity: 0;
  transition: transform .5s var(--ease-out), opacity .4s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover::after { transform: scaleX(1); transform-origin: left; opacity: 1; }
.btn-primary span { position: relative; z-index: 1; }
.btn-arrow svg { transition: transform .4s var(--ease-out); }
.btn:hover .btn-arrow svg { transform: translateX(5px); }

.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: background .5s, padding .5s, box-shadow .5s, backdrop-filter .5s;
}
.nav.stuck {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  padding: 14px var(--gutter);
  box-shadow: 0 1px 0 var(--line-soft);
}
.brandmark { font-family: var(--font-script); font-size: 30px; color: var(--ink); line-height: 1; text-decoration: none; }
.nav.stuck .brandmark { font-size: 26px; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-link {
  font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  text-decoration: none; position: relative; padding: 4px 0; white-space: nowrap;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 820px) { .nav-links .nav-link:not(.nav-cta) { display: none; } }

/* nav CTA — editorial link with accent, not a SaaS pill */
.nav-cta { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.nav-cta::after { background: var(--accent); height: 2px; }
.nav-cta .nav-cta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; transition: transform .4s var(--ease-out); }
.nav-cta:hover .nav-cta-dot { transform: scale(1.5); }

/* ---------- watercolor blob helper ---------- */
.wc {
  position: absolute; border-radius: 50%;
  filter: blur(0px) url(#wc-edge);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* floating drift animation */
@keyframes drift {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  33%     { transform: translate(2%, -3%) rotate(4deg) scale(1.05); }
  66%     { transform: translate(-2%, 2%) rotate(-3deg) scale(0.97); }
}

/* slow spin */
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ---------- IMAGE-SLOT placeholder beautification ---------- */image-slot::part(frame) {
  background-image: var(--slot-tint, linear-gradient(160deg, var(--accent), var(--accent-2)));
  background-size: cover; background-position: center;
}
image-slot::part(empty) {
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 3px rgba(0,0,0,.32);
  font-family: var(--font-body);
}

/* ---------- scroll progress + form shake ---------- */.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-4)); transform: scaleX(0); transform-origin: left; }

@keyframes shake-x { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }
.form.shake { animation: shake-x .5s var(--ease-soft); }

/* ---------- INTRO CURTAIN ---------- */
.intro {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: opacity .8s var(--ease-out), transform 1s var(--ease-out), clip-path 1s var(--ease-out);
}
.intro.lift { opacity: 0; transform: scale(1.04); pointer-events: none; }
.intro-wc { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; mix-blend-mode: multiply; }
.intro-inner { position: relative; text-align: center; z-index: 1; padding: 20px; }
.intro-eyebrow {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase; color: var(--accent);
  opacity: 1; animation: intro-fade .9s var(--ease-out) .2s both;
}
.intro-name {
  font-family: var(--font-script); font-size: clamp(64px, 13vw, 168px);
  line-height: .95; color: var(--ink); margin: 10px 0 6px;
  opacity: 1;
  animation: intro-rise 1.1s var(--ease-out) .4s both;
}
.intro-rule {
  height: 2px; width: 140px; background: var(--accent); margin: 14px auto 18px;
  animation: intro-rule 1s var(--ease-out) 1s both;
}
.intro-sub {
  font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 2.4vw, 28px);
  color: var(--ink-soft); opacity: 1; animation: intro-fade 1s var(--ease-out) 1.2s both;
}
.intro-skip {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); opacity: .7; animation: intro-fade 1s ease 1.6s both;
}
@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes intro-rule { from { width: 0; } to { width: 140px; } }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }

footer { background: var(--ink); color: var(--paper); }
