/* ══════════════════════════════════════
   STHEFANIE PINA — SINGLE SLIDE
   ══════════════════════════════════════ */

:root {
  --c: #7a6c58;
  --bg: #FDFBF8;
  --pad: clamp(24px, 3.5vw, 48px);
  --baseline: clamp(20px, 2vw, 26px);
}

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

html {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--c);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: none;
  overflow: hidden;
  font-weight: 400;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: var(--baseline);
  height: 100%;
}

/* ── GRAIN ── */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9000;
  pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── CURSOR ── */
#cur { position: fixed; width: 6px; height: 6px; background: var(--c); border-radius: 50%; pointer-events: none; z-index: 10001; mix-blend-mode: multiply; }
#curRing { position: fixed; width: 32px; height: 32px; border: 1px solid var(--c); border-radius: 50%; pointer-events: none; z-index: 10000; transition: width .3s, height .3s; }
body.on-int #curRing { width: 48px; height: 48px; }
a, button { cursor: none; }

/* ── MOBILE-ONLY (hidden on desktop) ── */
.m-draw-btn,
.m-draw-spacer,
.m-draw-spacer-bottom,
.m-canvas-overlay,
.m-header-email,
.m-title { display: none; }

/* ══════════════════════════════════════
   DESKTOP — CSS GRID, 100vw × 100vh
   ══════════════════════════════════════ */

.slide {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: var(--pad);
  display: grid;
  grid-template-columns: [photo-start] minmax(200px, 38%) [photo-end gap-start] clamp(24px,3vw,48px) [gap-end content-start] 1fr [content-end];
  grid-template-rows: auto 1fr auto;
  gap: 0;
  overflow: hidden;
}

/* ── PHOTO ── */
.photo {
  grid-column: photo-start / photo-end;
  grid-row: 1 / -1;
  overflow: hidden;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  animation: photoIn 2.2s .1s cubic-bezier(.16,1,.3,1) forwards;
}

/* ── CELLS ── */
.cell {
  color: var(--c);
  opacity: 0;
  transform: translateY(16px);
  animation: cellIn 1.2s cubic-bezier(.16,1,.3,1) forwards;
}

/* ── LOGO + EMAIL ── */
.cell-logo {
  grid-column: content-start / content-end;
  grid-row: 1;
  align-self: start;
  padding-top: clamp(4px, 1vh, 12px);
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 1.5vw, 24px);
  animation-delay: .3s;
}
.cell-logo svg {
  height: clamp(40px, 6vh, 60px);
  width: auto;
  color: var(--c);
  display: block;
  flex-shrink: 0;
}
.logo-info {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex: 1;
  gap: clamp(24px, 3vw, 48px);
  padding-top: clamp(2px, .5vh, 6px);
}
.logo-email {
  margin-left: auto;
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: .04em;
  color: var(--c);
  text-decoration: none;
}
.logo-role { font-size: clamp(14px, 1.4vw, 18px); letter-spacing: .04em; }
.logo-breve { font-size: clamp(14px, 1.4vw, 18px); letter-spacing: .04em; }

/* ── SKETCH CANVAS ── */
.cell-sketch-wrap {
  grid-column: content-start / content-end;
  grid-row: 2;
  position: relative;
  align-self: stretch;
  opacity: 0;
  animation: cellIn 1.2s .6s cubic-bezier(.16,1,.3,1) forwards;
}
.cell-sketch {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none; display: block;
}
.cell-sketch--grid { pointer-events: none; opacity: 0; transition: opacity .4s ease; }
.cell-sketch--grid.on { opacity: 1; }

/* ── TOOLBAR PILL ── */
.toolbar {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 8000;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 6px;
  background: color-mix(in srgb, var(--bg) 85%, var(--c) 5%);
  border: 1px solid color-mix(in srgb, var(--c) 10%, transparent);
  border-radius: 100px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; animation: cellIn 1.2s .8s cubic-bezier(.16,1,.3,1) forwards;
}
.tb-btn {
  width: 32px; height: 32px; border: none; background: none;
  color: var(--c); border-radius: 50%;
  display: grid; place-items: center;
  opacity: 0.35; transition: opacity .25s, background .25s;
  padding: 0; line-height: 0;
}
.tb-btn:hover { opacity: 0.6; background: color-mix(in srgb, var(--c) 6%, transparent); }
.tb-btn.active { opacity: 1; background: color-mix(in srgb, var(--c) 10%, transparent); }
.tb-sep { width: 16px; height: 1px; background: color-mix(in srgb, var(--c) 12%, transparent); margin: 4px 0; }
.tb-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent; background: var(--sw); padding: 0;
  opacity: 0.45; transition: opacity .25s, border-color .25s, transform .25s;
  transform: scale(0.85);
}
.tb-swatch:hover { opacity: 0.75; transform: scale(1); }
.tb-swatch.active { opacity: 1; border-color: color-mix(in srgb, var(--sw) 40%, var(--bg)); transform: scale(1); box-shadow: 0 0 0 1px var(--sw); }

/* ── NAME ── */
.cell-name {
  grid-column: content-start / content-end;
  grid-row: 2; align-self: end;
  padding-bottom: calc(var(--baseline) * 1.5);
  animation-delay: .4s;
}
.cell-name h1 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(28px, 3.5vw, 56px);
  font-weight: 300; letter-spacing: .03em;
  line-height: calc(var(--baseline) * 2);
}

/* ── BIO ── */
.cell-bio {
  grid-column: content-start / content-end;
  grid-row: 3; align-self: end;
  columns: 2; column-gap: clamp(24px, 2.5vw, 44px);
  column-fill: balance; animation-delay: .55s;
}
.cell-bio p {
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: var(--baseline); font-weight: 400;
  margin-bottom: var(--baseline);
}
.cell-bio p:last-child { margin-bottom: 0; }
.bio-cta {
  column-span: all;
  margin-top: calc(var(--baseline) * 0.5);
  padding-top: calc(var(--baseline) * 0.75);
  border-top: 1px solid color-mix(in srgb, var(--c) 15%, transparent);
  display: flex; align-items: baseline; gap: 0.4em;
  font-size: clamp(14px, 1.4vw, 18px); letter-spacing: .02em;
}
.bio-cta .cta-text { opacity: 0.6; }
.bio-cta a {
  color: var(--c); text-decoration: none; position: relative;
  transition: letter-spacing .4s cubic-bezier(.16,1,.3,1), opacity .3s;
}
.bio-cta a::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: var(--c);
  opacity: 0; transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .4s;
}
.bio-cta a:hover::after { transform: scaleX(1); opacity: 0.4; }
.bio-cta a:hover { letter-spacing: .06em; }

/* ── KEYFRAMES ── */
@keyframes photoIn { to { opacity: 1; transform: scale(1); } }
@keyframes cellIn { to { opacity: 1; transform: translateY(0); } }


/* ══════════════════════════════════════
   MOBILE (max-width: 768px)
   ══════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── reset desktop locks ── */
  html { overflow: auto; height: auto; }
  body { overflow: auto; height: auto; cursor: auto; }
  a, button { cursor: auto; }
  #cur, #curRing { display: none; }

  /* ── page ── */
  .slide {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding: 0 0 max(80px, calc(env(safe-area-inset-bottom) + 80px)) 0;
    overflow: visible;
    gap: 0;
  }

  /* ── header: logo center, name left, email right ── */
  .cell-logo {
    order: 1;
    display: flex;
    align-items: flex-start;
    padding: 24px 20px 24px;
    animation: none; opacity: 1;
  }
  .cell-logo svg {
    height: 44px; width: auto;
    position: static;
    transform: none;
  }
  .logo-info { display: none; }

  .cell-name { display: none; }

  .m-header-email {
    display: block;
    position: absolute;
    right: 20px; top: 32px;
    font-size: 14px; letter-spacing: .03em;
    color: var(--c); text-decoration: none;
    opacity: 1; z-index: 1;
  }

  /* ── photo with passepartout ── */
  .photo {
    order: 2;
    width: calc(100% - 40px);
    max-height: 45vh;
    overflow: hidden;
    margin: 8px auto 0;
    border-radius: 2px;
    animation: none; opacity: 1;
  }
  .photo img { animation: none; opacity: 1; transform: none; }

  /* ── title ── */
  .m-title {
    display: block; order: 3;
    padding: 24px 20px 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 28px; font-weight: 300;
    letter-spacing: .03em; line-height: 1.2;
    color: var(--c);
  }

  /* ── bio ── */
  .cell-bio {
    order: 4; columns: 1;
    padding: 16px 20px 0;
    animation: none; opacity: 1;
  }
  .cell-bio p { font-size: 14px; line-height: 1.65; margin-bottom: 14px; }
  .bio-cta { flex-wrap: wrap; border-top: none; padding-top: 0; margin-top: 0; }
  .bio-cta .cta-text { opacity: 0.5; font-size: 13px; }
  .bio-cta a { font-size: 13px; }

  /* ── hide desktop canvas ── */
  .cell-sketch-wrap { display: none; }

  /* ── spacers (hidden, not needed) ── */
  .m-draw-spacer, .m-draw-spacer-bottom { display: none; }

  /* ── + button fixed bottom ── */
  .m-draw-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: 50%; transform: translateX(-50%);
    z-index: 9000;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--c);
    background: color-mix(in srgb, var(--bg) 90%, var(--c) 3%);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: var(--c); opacity: 0.6;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    animation: plusPulse 6s ease-in-out infinite;
  }
  .m-draw-btn:active {
    transform: translateX(-50%) scale(0.9) rotate(90deg);
    opacity: 0.8; animation: none;
  }

  @keyframes plusPulse {
    0%, 85%, 100% { transform: translateX(-50%) rotate(0deg); opacity: 0.5; }
    92% { transform: translateX(-50%) rotate(90deg); opacity: 0.7; }
  }

  /* ── canvas sheet ── */
  .m-canvas-overlay {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; top: 56px;
    z-index: 9010;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform .55s cubic-bezier(0.175, 0.885, 0.32, 1.05);
    pointer-events: none;
    will-change: transform;
  }
  .m-canvas-overlay.open {
    transform: translateY(0);
    pointer-events: auto;
  }
  .m-canvas-overlay::before {
    content: ''; display: block;
    width: 36px; height: 4px; border-radius: 2px;
    background: color-mix(in srgb, var(--c) 18%, transparent);
    margin: 10px auto 6px;
  }
  .m-canvas-wrap { position: absolute; top: 20px; left: 0; right: 0; bottom: 0; }
  .m-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    touch-action: none; display: block;
  }
  .m-canvas--grid { pointer-events: none; opacity: 0; transition: opacity .4s ease; }
  .m-canvas--grid.on { opacity: 1; }

  .m-canvas-close {
    position: absolute; top: 6px; right: 12px; z-index: 9012;
    width: 40px; height: 40px; border-radius: 50%;
    border: none; background: none; color: var(--c);
    display: grid; place-items: center; opacity: 0.4;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }

  /* ── floating toolbar inside sheet ── */
  .m-canvas-overlay .toolbar {
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 50%; transform: translateX(-50%);
    right: auto; top: auto;
    flex-direction: row; flex-wrap: nowrap;
    justify-content: center; align-items: center;
    gap: 2px; padding: 6px 10px;
    height: auto; width: auto;
    max-width: calc(100vw - 32px);
    border-radius: 100px;
    border: 1px solid color-mix(in srgb, var(--c) 10%, transparent);
    background: color-mix(in srgb, var(--bg) 85%, var(--c) 5%);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    z-index: 9011; animation: none; opacity: 1;
  }
  .m-canvas-overlay .tb-btn { width: 40px; height: 40px; flex-shrink: 0; }
  .m-canvas-overlay .tb-btn svg { width: 18px; height: 18px; }
  .m-canvas-overlay .tb-swatch { width: 24px; height: 24px; flex-shrink: 0; transform: scale(1); }
  .m-canvas-overlay .tb-swatch.active { transform: scale(1); }
  .m-canvas-overlay .tb-sep { width: 1px; height: 20px; margin: 0 4px; flex-shrink: 0; }
}
