/* ==========================================================================
   Josué Valles — portfolio v2
   Visual identity borrowed from the talk "Tocar puertas." (GDG Pura Vida)
   Fraunces (display) · Nunito (body) · Caveat (hand-written accents)
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces_it.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("assets/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("assets/fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* brand palette (from the deck) */
  --sun: #F5B700;
  --sun-2: #FFD34D;
  --sun-3: #FFE9A3;
  --amber: #E8890C;
  --terra: #B8430B;
  --cream: #FFF6E0;
  --brown: #2B1A0E;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Nunito", "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --radius: 22px;
  --radius-sm: 14px;
  --container: 70rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Light = cream (default) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #FFF6E0;
  --paper: #FFFCF3;
  --text: #2B1A0E;
  --muted: #6B4A2B;
  --accent: #B8430B;          /* text-safe accent on cream */
  --line: rgba(43, 26, 14, .13);
  --line-strong: rgba(43, 26, 14, .22);
  --mark: #FFD34D;            /* highlighter */
  --scribble: #B8430B;
  --chip-dot: #F5B700;
  --chip-ring: rgba(245, 183, 0, .28);
  --blob: #FFE9A3;
  --blob-2: rgba(232, 137, 12, .14);
  --header-bg: rgba(255, 246, 224, .82);
  --shadow: 0 30px 60px -30px rgba(91, 46, 6, .38), 0 8px 20px -10px rgba(91, 46, 6, .16);
  --shadow-sm: 0 2px 0 rgba(43, 26, 14, .06), 0 10px 24px -14px rgba(91, 46, 6, .38);
  --btn-bg: #2B1A0E;  --btn-fg: #FFF6E0;
  --cta-bg: #F5B700;  --cta-fg: #2B1A0E;  --cta-muted: #4A2F17;
  --cta-btn-bg: #2B1A0E; --cta-btn-fg: #FFF6E0;
  --cta-scribble: #FFFCF3;
  --talk-sun-bg: #F5B700; --talk-sun-fg: #2B1A0E; --talk-sun-muted: #4A2F17;
  --door-frame: #2B1A0E;
  --door-light: #FFF6E0; --door-leaf: #E8890C; --door-knob: #FFD34D;
  --idtop: #F5B700;
  --focus: #B8430B;
  --grain-opacity: .07;
}

/* Dark = warm brown, gold accents */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1F140B;
  --paper: #2B1D11;
  --text: #FFF6E0;
  --muted: #E2CCA8;
  --accent: #FFD34D;
  --line: rgba(255, 233, 163, .14);
  --line-strong: rgba(255, 233, 163, .26);
  --mark: rgba(232, 137, 12, .55);
  --scribble: #F5B700;
  --chip-dot: #F5B700;
  --chip-ring: rgba(245, 183, 0, .22);
  --blob: rgba(245, 183, 0, .16);
  --blob-2: rgba(232, 137, 12, .14);
  --header-bg: rgba(31, 20, 11, .82);
  --shadow: 0 30px 60px -28px rgba(0, 0, 0, .6), 0 8px 20px -10px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 0 rgba(0, 0, 0, .18), 0 12px 26px -14px rgba(0, 0, 0, .6);
  --btn-bg: #FFD34D;  --btn-fg: #2B1A0E;
  --cta-bg: #2B1D11;  --cta-fg: #FFF6E0;  --cta-muted: #E2CCA8;
  --cta-btn-bg: #F5B700; --cta-btn-fg: #2B1A0E;
  --cta-scribble: #F5B700;
  --talk-sun-bg: #F5B700; --talk-sun-fg: #2B1A0E; --talk-sun-muted: #4A2F17;
  --door-frame: #FFD34D;
  --door-light: #FFF6E0; --door-leaf: #E8890C; --door-knob: #FFD34D;
  --idtop: #F5B700;
  --focus: #FFD34D;
  --grain-opacity: .05;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background-color .4s ease, color .4s ease;
}
/* paper grain, like the deck */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .05 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-optical-sizing: auto; color: var(--text); }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--brown); color: var(--cream);
  padding: .6rem 1rem; border-radius: 999px; font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Top-right toggles ---------- */
.top-bar { position: fixed; top: 1rem; right: 1rem; z-index: 40; display: flex; gap: .5rem; }
.icon-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-items: center;
  font-weight: 850; font-size: .82rem; letter-spacing: .06em;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .2s, background-color .3s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { grid-area: 1 / 1; }
[data-theme="light"] .ico-sun, [data-theme="dark"] .ico-moon { display: none; }

/* ---------- Single centered column (link-in-bio structure) ---------- */
.shell {
  position: relative;
  z-index: 1;
  width: min(36rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 4.75rem 0 2.5rem;
}

/* ---------- Shared type ---------- */
.eyebrow {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  font-weight: 800; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .6rem;
}
.eyebrow::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--amber); flex: none; }
.block h2 {
  text-align: center;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  line-height: 1.1; font-weight: 650; letter-spacing: -.025em;
  margin-bottom: 1.5rem; text-wrap: balance;
}
.hand { font-family: var(--hand); font-weight: 650; }

.mk {
  font-style: italic;
  background: linear-gradient(100deg, transparent 0 1%, var(--mark) 2% 97%, transparent 98%) no-repeat 0 85% / 100% 40%;
  padding: 0 .08em; margin: 0 -.04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ul { position: relative; display: inline-block; white-space: nowrap; }
.ul svg { position: absolute; left: -3%; bottom: -.12em; width: 106%; height: .22em; overflow: visible; pointer-events: none; }
.ul path { fill: none; stroke: var(--scribble); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* ---------- Buttons / text links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .75rem 1.35rem; border-radius: 999px;
  font-weight: 850; font-size: 1rem; text-decoration: none;
  transition: transform .18s var(--ease), background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sun); color: #2B1A0E; box-shadow: inset 0 -3px 0 rgba(43, 26, 14, .14); }
.btn-primary:hover { background: var(--sun-2); }
.btn-ink { background: var(--cta-btn-bg); color: var(--cta-btn-fg); box-shadow: 0 12px 26px -14px rgba(43, 26, 14, .7); }
.btn-sm { min-height: 2.75rem; padding: .55rem 1.1rem; font-size: .95rem; }
.tlink {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 2.75rem;
  font-weight: 850; color: var(--accent);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.tlink:hover { text-decoration-color: currentColor; }

/* ---------- Identity ---------- */
.identity { display: flex; flex-direction: column; align-items: center; text-align: center; }
.photo { position: relative; width: 9.5rem; margin-bottom: 1.6rem; }
.arch {
  position: relative; margin: 0; aspect-ratio: 4 / 5;
  border-radius: 50% 50% 20px 20px / 40% 40% 20px 20px;
  border: 7px solid var(--paper); background: var(--paper);
  overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.blob {
  position: absolute; z-index: -1; width: 150%; height: 110%; left: -25%; top: -2%;
  background: var(--blob);
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation: morph 18s ease-in-out infinite alternate;
}
@keyframes morph { to { border-radius: 58% 42% 38% 62% / 55% 38% 62% 45%; transform: rotate(5deg) scale(1.03); } }
.sticker {
  position: absolute; right: -3.4rem; bottom: .9rem;
  background: var(--paper); color: var(--text);
  font-family: var(--hand); font-weight: 700; font-size: 1.3rem; line-height: 1;
  padding: .6rem .85rem .5rem; border-radius: 6px 6px 16px 6px;
  box-shadow: 0 16px 28px -14px rgba(91, 46, 6, .55);
  transform: rotate(-6deg); white-space: nowrap;
}
.tape {
  position: absolute; top: -.6rem; left: 50%; width: 3rem; height: 1rem;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(255, 211, 77, .85); border-radius: 2px; box-shadow: 0 1px 4px rgba(91, 46, 6, .15);
}
.name { font-size: clamp(2.5rem, 10vw, 3.4rem); line-height: 1; font-weight: 700; letter-spacing: -.035em; }
.tagline {
  margin-top: .85rem; font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: 1.3rem; line-height: 1.25; color: var(--text);
}
.place { margin-top: .35rem; display: inline-flex; align-items: center; gap: .45rem; font-weight: 750; font-size: .95rem; color: var(--muted); }
.place .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--amber); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.25rem; }
.socials a {
  width: 2.85rem; height: 2.85rem; display: grid; place-items: center; border-radius: 999px;
  background: var(--paper); border: 1.5px solid var(--line); color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), border-color .2s, color .2s;
}
.socials a:hover { transform: translateY(-2px) rotate(-4deg); border-color: var(--accent); color: var(--accent); }
.lede { margin-top: 1.35rem; max-width: 27rem; color: var(--muted); font-size: 1.05rem; text-wrap: balance; }

/* ---------- Link cards (paper stickers) ---------- */
.links { display: flex; flex-direction: column; gap: .8rem; margin-top: 2.25rem; }
.card {
  display: flex; align-items: center; gap: .9rem;
  min-height: 4.5rem; padding: .8rem 1.1rem .8rem .85rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px 16px 24px 16px;
  box-shadow: var(--shadow-sm); text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px) rotate(-.5deg); border-color: var(--line-strong); box-shadow: var(--shadow); }
.cicon {
  flex: none; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--sun-3); color: #2B1A0E; box-shadow: 0 0 0 4px var(--chip-ring);
}
.ctext { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ctext strong { font-weight: 850; font-size: 1.02rem; }
.ctext small { font-size: .875rem; color: var(--muted); }
.carrow { flex: none; color: var(--muted); transition: transform .2s var(--ease), color .2s; }
.card:hover .carrow { color: var(--accent); transform: translate(2px, -2px); }
.card-sun { background: var(--sun); border-color: transparent; color: #2B1A0E; }
.card-sun .ctext small, .card-sun .carrow { color: #4A2F17; }
.card-sun .cicon { background: var(--paper); box-shadow: none; }
[data-theme="dark"] .card-sun .cicon { background: #FFF6E0; }
.card-sun:hover .carrow { color: #2B1A0E; }
.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .8rem; }
.card-mini { min-height: 3.25rem; justify-content: center; gap: .55rem; padding: .6rem .9rem; font-weight: 850; font-size: .95rem; border-radius: 999px; }

/* ---------- Sections ---------- */
.block { margin-top: clamp(4.5rem, 12vw, 6.5rem); }
.text { text-align: center; color: var(--muted); font-size: 1.08rem; max-width: 30rem; margin: 0 auto; text-wrap: balance; }
.text + .text { margin-top: .7rem; }

.idcard {
  margin: 2.25rem auto 0; max-width: 20rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 24px;
  overflow: hidden; box-shadow: var(--shadow); transform: rotate(1.5deg);
}
.idcard-top { background: var(--idtop); color: #2B1A0E; padding: .6rem 1.4rem .45rem; font-family: var(--hand); font-weight: 700; font-size: 1.55rem; line-height: 1; }
.idcard dl { margin: 0; padding: .25rem 0 .45rem; }
.idcard .row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .6rem 1.4rem; border-top: 2px dashed var(--line); }
.idcard .row:first-child { border-top: 0; }
.idcard dt { font-family: var(--hand); font-weight: 600; font-size: 1.3rem; color: var(--muted); line-height: 1; }
.idcard dd { margin: 0; font-family: var(--display); font-weight: 650; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.15; text-align: right; }

/* Projects */
.feature {
  position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(1.35rem, 5vw, 2rem); box-shadow: var(--shadow);
}
.feature::after {
  content: ""; position: absolute; width: 15rem; height: 13rem; right: -6rem; top: -6.5rem;
  background: var(--blob); border-radius: 61% 39% 45% 55% / 52% 61% 39% 48%; z-index: 0; opacity: .85;
}
.feature > * { position: relative; z-index: 1; }
.feature-top { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-bottom: .75rem; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #2B1A0E; color: #FFF6E0; font-weight: 850; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .28rem .7rem; border-radius: 999px;
}
.badge::before { content: "★"; letter-spacing: 0; }
[data-theme="dark"] .badge { background: var(--sun); color: #2B1A0E; }
.meta { font-weight: 750; font-size: .9rem; color: var(--muted); }
.feature-title { font-size: clamp(2.4rem, 9vw, 3rem); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.feature-desc { margin-top: .75rem; color: var(--muted); font-size: 1.06rem; text-wrap: pretty; }
.feature-flow { margin-top: 1.4rem; }
.flow-label { display: inline-block; font-size: 1.45rem; color: var(--accent); transform: rotate(-2deg); margin-bottom: .5rem; }
.flow { display: flex; flex-direction: column; gap: 1.35rem; }
.node {
  position: relative; display: flex; align-items: center; gap: .75rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: .7rem 1rem; font-weight: 800; font-size: .98rem; box-shadow: var(--shadow-sm);
  max-width: 21rem;
}
.node:nth-child(1) { transform: rotate(-.8deg); }
.node:nth-child(2) { transform: rotate(.7deg); margin-left: 1.25rem; }
.node:nth-child(3) { margin-left: .5rem; }
.node.on { background: var(--sun); color: #2B1A0E; border-color: transparent; box-shadow: 0 0 0 5px var(--chip-ring), var(--shadow-sm); }
.node .n {
  flex: none; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--sun-3); color: #2B1A0E; font-family: var(--display); font-weight: 700; font-size: .95rem;
}
.node.on .n { background: #2B1A0E; color: var(--sun-2); }
.node:not(:last-child)::after {
  content: ""; position: absolute; left: 1.75rem; bottom: -1.35rem; width: 1.1rem; height: 1.3rem;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 62'%3E%3Cpath d='M22 4 C30 18 14 34 23 54' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M12 44 L23 56 L34 45' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 62'%3E%3Cpath d='M22 4 C30 18 14 34 23 54' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M12 44 L23 56 L34 45' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.stack { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.5rem 0 1.25rem; }
.stack li { font-size: .82rem; font-weight: 800; padding: .26rem .65rem; border-radius: 10px; border: 1.5px solid var(--line-strong); }
.feature-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }

/* Experience */
.timeline { display: flex; flex-direction: column; gap: .8rem; }
.tl-item {
  position: relative; padding: 1.1rem 1.25rem 1.1rem 2.9rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm);
}
.tl-item::before {
  content: ""; position: absolute; left: 1.25rem; top: 1.5rem; width: .62rem; height: .62rem; border-radius: 50%;
  background: var(--chip-dot); box-shadow: 0 0 0 5px var(--chip-ring);
}
.when { display: block; font-weight: 800; font-size: .85rem; color: var(--muted); }
.tl-item h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; margin-top: .15rem; }
.tl-item h3 .at { font-weight: 450; }
.tl-item p { color: var(--muted); font-size: .98rem; margin-top: .2rem; }
.tl-item .tlink { font-size: .92rem; min-height: 2.5rem; margin-bottom: -.4rem; }

/* Talks */
.talks { display: grid; gap: .9rem; }
.talk {
  position: relative; overflow: hidden; display: flex; flex-direction: column; height: 100%;
  padding: 1.35rem 1.35rem 1.2rem; border-radius: 24px;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; transition: transform .25s var(--ease), box-shadow .2s;
}
.talk:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: var(--shadow); }
.talk-icon { color: var(--door-frame); margin-bottom: .8rem; transition: transform .4s var(--ease); }
.talk:hover .talk-icon { transform: rotate(-3deg) scale(1.05); }
.talk-meta { font-weight: 800; font-size: .86rem; color: var(--muted); }
.talk-title { font-family: var(--display); font-weight: 700; font-size: 1.7rem; letter-spacing: -.025em; line-height: 1.1; margin-top: .2rem; }
.talk-desc { margin-top: .35rem; color: var(--muted); font-size: .98rem; }
.talk-cta { margin-top: auto; padding-top: 1rem; display: inline-flex; align-items: center; gap: .3rem; font-weight: 850; color: var(--accent); }
.talk-sun { background: var(--talk-sun-bg); color: var(--talk-sun-fg); border-color: transparent; --door-frame: #2B1A0E; }
.talk-sun .talk-meta, .talk-sun .talk-desc { color: var(--talk-sun-muted); }
.talk-sun .talk-cta { color: #2B1A0E; }
.talk-sun::after {
  content: ""; position: absolute; width: 11rem; height: 10rem; right: -4rem; top: -4.5rem;
  background: rgba(255, 246, 224, .42); border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
}
.talk > * { position: relative; z-index: 1; }

/* Contact */
.cta {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--cta-bg); color: var(--cta-fg);
  border: 1px solid var(--line); border-radius: 32px;
  padding: 2.25rem clamp(1.25rem, 5vw, 2.5rem) 2.25rem; box-shadow: var(--shadow);
  --scribble: var(--cta-scribble);
}
.cta h2 { color: var(--cta-fg); margin-bottom: .9rem; text-align: center; font-size: clamp(1.9rem, 6vw, 2.5rem); line-height: 1.1; font-weight: 650; letter-spacing: -.025em; }
.cta-lede { color: var(--cta-muted); font-weight: 650; max-width: 24rem; margin-bottom: 1.5rem; text-wrap: balance; }
.email-link {
  margin-top: 1rem; font-weight: 800; color: var(--cta-fg);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); overflow-wrap: anywhere;
  min-height: 2.75rem; display: inline-flex; align-items: center;
}
.email-link:hover { text-decoration-color: currentColor; }

.door-scene { position: relative; width: 6.5rem; height: 8.25rem; margin: .25rem 0 2.1rem; }
.door-halo {
  position: absolute; inset: -55% -95%;
  background: radial-gradient(closest-side, rgba(255, 252, 238, .95), rgba(255, 240, 190, .55) 40%, rgba(255, 226, 140, 0) 100%);
  transition: opacity 2s ease .4s, transform 2.4s var(--ease) .4s;
}
[data-theme="dark"] .door-halo { background: radial-gradient(closest-side, rgba(255, 211, 77, .34), rgba(245, 183, 0, .12) 45%, rgba(245, 183, 0, 0) 100%); }
.door {
  position: absolute; inset: 0; padding: 6px; background: var(--door-frame);
  border-radius: 50% 50% 10px 10px / 39% 39% 10px 10px;
  box-shadow: 0 24px 44px -22px rgba(91, 46, 6, .6);
}
.door-open {
  position: relative; width: 100%; height: 100%; overflow: hidden; perspective: 600px;
  border-radius: 50% 50% 6px 6px / 37% 37% 6px 6px;
  background: radial-gradient(ellipse 70% 58% at 50% 76%, #FFFFFF 0%, #FFFBEE 18%, #FFF1C6 40%, #FFDE7A 68%, #F7BE45 100%);
}
.door-leaf {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, #C96F0A, #E8890C 60%, #F09A22);
  transform-origin: left center; transform: rotateY(66deg);
  box-shadow: inset -6px 0 14px rgba(91, 46, 6, .35);
  transition: transform 1.8s cubic-bezier(.3, .6, .2, 1) .3s;
}
.door-leaf::before { content: ""; position: absolute; left: 14%; right: 14%; top: 16%; height: 30%; border: 2px solid rgba(43, 26, 14, .22); border-radius: 200px 200px 6px 6px; }
.door-knob { position: absolute; right: 11%; top: 55%; width: 8px; height: 8px; border-radius: 50%; background: var(--sun-2); }
.door-floor {
  position: absolute; left: -45%; right: -45%; top: calc(100% - 4px); height: 2.2rem;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 253, 244, .95), rgba(255, 244, 205, .5) 45%, rgba(255, 232, 160, 0));
  filter: blur(3px);
}
.door-note { position: absolute; left: calc(100% + .5rem); top: -.2rem; width: 6.5rem; font-size: 1.3rem; line-height: 1; color: var(--cta-fg); transform: rotate(8deg); text-align: left; }
.js .cta:not(.in) .door-leaf { transform: rotateY(0deg); }
.js .cta:not(.in) .door-halo { opacity: 0; transform: scale(.85); }

/* Footer */
.foot { margin-top: 3.5rem; display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; color: var(--muted); font-size: .9rem; font-weight: 650; }
.foot-door { color: var(--door-frame); margin-bottom: .4rem; opacity: .9; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }

/* ---------- Pixel art (sprites generated by tools/pixel_art.py) ----------
   Each <path> carries a colour class; colours live here so both themes can tune them. */
:root,
[data-theme="light"] {
  --px-o: #2B1A0E;  /* ink outline + eyes */
  --px-f: #F5B700;  /* fur / gold */
  --px-h: #FFD34D;  /* highlight */
  --px-s: #E8890C;  /* amber shade */
  --px-c: #FFE9A3;  /* cream */
  --px-w: #FFF6E0;  /* glint / paper */
  --px-e: #B8430B;  /* terra (ears, collar) */
  --px-d: #6B4A2B;  /* soil / dark wood */
  --px-D: #4A2F17;  /* soil furrow */
  --px-b: #A0662E;  /* wood */
  --px-l: #8E8F3A;  /* leaf, warm olive */
  --px-rim: transparent;
  --pup-shadow: rgba(91, 46, 6, .22);
}
[data-theme="dark"] {
  --px-o: #140C05;  /* a touch deeper than the bg so the line still reads */
  --px-w: #FFFCF3;
  --px-e: #D0561A;  /* terra lifted so the ears don't sink into the brown */
  --px-d: #8A6238;  /* soil/wood lifted a step */
  --px-D: #654221;
  --px-b: #BC7D3D;
  --px-l: #A9AA4A;
  --px-rim: rgba(255, 211, 77, .5); /* 1px warm rim so the ink outline doesn't vanish */
  --pup-shadow: rgba(0, 0, 0, .45);
}
.px { display: block; flex: none; overflow: visible; }
.px .po { fill: var(--px-o); }
.px .pf { fill: var(--px-f); }
.px .ph { fill: var(--px-h); }
.px .ps { fill: var(--px-s); }
.px .pc { fill: var(--px-c); }
.px .pw { fill: var(--px-w); }
.px .pe { fill: var(--px-e); }
.px .pd { fill: var(--px-d); }
.px .pD { fill: var(--px-D); }
.px .pb { fill: var(--px-b); }
.px .pl { fill: var(--px-l); }
[data-theme="dark"] .px-fence,
[data-theme="dark"] .pup-svg,
[data-theme="dark"] .pup-crops .px {
  filter: drop-shadow(1px 0 0 var(--px-rim)) drop-shadow(-1px 0 0 var(--px-rim)) drop-shadow(0 -1px 0 var(--px-rim));
}
.px-sun { display: inline-block; width: 1.25rem; height: 1.25rem; }
.px-divider { display: flex; justify-content: center; margin: clamp(3.25rem, 9vw, 4.5rem) 0 calc(-1 * clamp(1.75rem, 6vw, 3rem)); opacity: .95; }
.px-divider .px { max-width: 100%; height: auto; }
.talk-icon .px-seed { width: 3rem; height: 3.5rem; }

/* ---------- Mascot: pixel puppy + tiny crop patch (logic in app.js) ---------- */
.pup {
  --pup-s: 2px; /* size of one sprite pixel */
  position: fixed; z-index: 30;
  right: max(.75rem, env(safe-area-inset-right));
  bottom: max(.75rem, env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: .1rem;
  pointer-events: none; /* only the sprite/buttons are interactive */
  transition: transform .45s var(--ease), opacity .3s ease, visibility 0s linear 0s;
}
.pup > * { pointer-events: auto; }
.pup.is-hidden { transform: translateY(140%); opacity: 0; visibility: hidden; transition: transform .45s var(--ease), opacity .3s ease, visibility 0s linear .45s; }
.pup-crops { display: none; pointer-events: none; }
.pup-crops .px { width: calc(30 * var(--pup-s)); height: calc(12 * var(--pup-s)); }
.pup-btn {
  position: relative; display: block; border-radius: 14px;
  width: calc(28 * var(--pup-s)); height: calc(25 * var(--pup-s));
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pup-btn::before { /* soft ground shadow */
  content: ""; position: absolute; left: 18%; right: 14%; bottom: -3px; height: 6px;
  border-radius: 50%; background: var(--pup-shadow); filter: blur(1.5px);
}
.pup-svg { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; transition: transform .2s var(--ease); }
.pup-btn:hover .pup-svg { transform: translateY(-2px); }
.pup-btn:active .pup-svg { transform: translateY(1px) scaleY(.94); }

/* sprite frames: tail A/B alternate, eyes blink, head tilts now and then */
.pup-tail-b, .pup-blink, .pup-head-r, .pup-head-l { opacity: 0; }
.pup-tail-a { animation: pup-on-off 1.1s steps(1, end) infinite; }
.pup-tail-b { animation: pup-off-on 1.1s steps(1, end) infinite; }
.pup-eyes { animation: pup-eyes 4.6s steps(1, end) infinite; }
.pup-blink { animation: pup-blink 4.6s steps(1, end) infinite; }
.pup-head-n { animation: pup-head-n 11s steps(1, end) infinite; }
.pup-head-r { animation: pup-head-t 11s steps(1, end) infinite; }
@keyframes pup-on-off { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pup-off-on { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes pup-eyes { 0% { opacity: 1; } 92% { opacity: 0; } 96% { opacity: 1; } }
@keyframes pup-blink { 0% { opacity: 0; } 92% { opacity: 1; } 96% { opacity: 0; } }
@keyframes pup-head-n { 0% { opacity: 1; } 64% { opacity: 0; } 76% { opacity: 1; } }
@keyframes pup-head-t { 0% { opacity: 0; } 64% { opacity: 1; } 76% { opacity: 0; } }

/* reactions: hover/focus = curious head tilt + faster wag; JS adds .is-happy (hop) and .is-look-l/.is-look-r */
.pup-btn:hover .pup-tail-a, .pup-btn:focus-visible .pup-tail-a, .pup.is-happy .pup-tail-a { animation-duration: .3s; }
.pup-btn:hover .pup-tail-b, .pup-btn:focus-visible .pup-tail-b, .pup.is-happy .pup-tail-b { animation-duration: .3s; }
.pup-btn:hover .pup-head-n, .pup-btn:focus-visible .pup-head-n,
.pup.is-look-l .pup-head-n, .pup.is-look-r .pup-head-n { animation: none; opacity: 0; }
.pup-btn:hover .pup-head-r, .pup-btn:focus-visible .pup-head-r, .pup.is-look-r .pup-head-r,
.pup.is-look-l .pup-head-l { animation: none; opacity: 1; }
.pup.is-look-l .pup-head-r { animation: none; opacity: 0; }
.pup.is-happy .pup-svg { animation: pup-hop .5s var(--ease) 2; }
@keyframes pup-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-7px) scaleY(1.03); } 70% { transform: translateY(0) scaleY(.95); } }

/* speech bubble (pixel-card style) */
.pup-bubble {
  position: absolute; right: .2rem; bottom: calc(100% + .7rem);
  width: max-content; max-width: min(15rem, calc(100vw - 2rem));
  padding: .45rem .8rem .4rem; border-radius: 4px;
  background: var(--paper); color: var(--text);
  border: 2px solid var(--text); box-shadow: 3px 3px 0 var(--amber);
  font-family: var(--hand); font-weight: 700; font-size: 1.25rem; line-height: 1.15; text-align: left;
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.96); transform-origin: 85% 100%;
  transition: opacity .2s ease, transform .25s var(--ease), visibility 0s linear .25s;
  pointer-events: none;
}
.pup-bubble::after { /* stepped pixel tail */
  content: ""; position: absolute; right: 1.6rem; top: 100%; width: 10px; height: 8px; margin-top: 2px;
  background: var(--text);
  clip-path: polygon(0 0, 100% 0, 100% 25%, 75% 25%, 75% 50%, 50% 50%, 50% 75%, 25% 75%, 25% 100%, 0 100%);
}
.pup.is-talking .pup-bubble:not(:empty) { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .25s var(--ease), visibility 0s; }

/* dismiss X */
.pup-hide {
  position: absolute; top: -.55rem; right: -.45rem;
  width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); color: var(--muted); border: 1.5px solid var(--line-strong); box-shadow: var(--shadow-sm);
  opacity: 0; transform: scale(.85); transition: opacity .2s ease, transform .2s var(--ease), color .2s;
}
.pup:hover .pup-hide, .pup:focus-within .pup-hide { opacity: 1; transform: none; }
.pup-hide:hover { color: var(--accent); border-color: var(--accent); }
@media (hover: none) { .pup-hide { opacity: .8; transform: none; } }

/* "bring the puppy back" (footer) */
.pup-show {
  margin-top: .35rem; min-height: 2.75rem; padding: 0 .5rem;
  font-family: var(--hand); font-weight: 700; font-size: 1.2rem; color: var(--accent);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
.pup-show:hover { text-decoration-color: currentColor; }

@media (min-width: 560px) { .pup-crops { display: block; margin-right: -.2rem; } }
@media (min-width: 768px) { .pup { --pup-s: 3px; right: 1.25rem; bottom: 1rem; } }
/* phones/tablets: the corner pup sits over the column, so leave room under the footer */
@media (max-width: 767px) { .shell { padding-bottom: calc(50px + 3.25rem); } }
@media (min-width: 768px) and (max-width: 1023px) { .shell { padding-bottom: calc(75px + 3.5rem); } }

/* ---------- Reveal (subtle) ---------- */
.js .r { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .r.in { opacity: 1; transform: none; }
.js .r.in.idcard { transform: rotate(1.5deg); }
.js .d1 { transition-delay: .07s; } .js .d2 { transition-delay: .14s; } .js .d3 { transition-delay: .21s; } .js .d4 { transition-delay: .28s; }
.js .r .ul svg { clip-path: inset(-50% 100% -50% -2%); }
.js .r.in .ul svg { clip-path: inset(-50% -2% -50% -2%); transition: clip-path .9s cubic-bezier(.4, .1, .2, 1) .55s; }
.js .r .mk { background-size: 0% 40%; transition: background-size .9s cubic-bezier(.3, .7, .2, 1) .45s; }
.js .r.in .mk { background-size: 100% 40%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .r { opacity: 1; transform: none; }
  .js .r.idcard { transform: rotate(1.5deg); }
  .js .r .mk { background-size: 100% 40%; }
  .js .r .ul svg { clip-path: none; }
  .js .cta:not(.in) .door-leaf { transform: rotateY(66deg); }
  .js .cta:not(.in) .door-halo { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .talk:hover, .socials a:hover, .icon-btn:hover { transform: none; }
  .pup-btn:hover .pup-svg, .pup-btn:active .pup-svg { transform: none; }
  .pup-tail-a, .pup-eyes, .pup-head-n { opacity: 1; }
  .pup-tail-b, .pup-blink, .pup-head-r, .pup-head-l { opacity: 0; }
  .pup.is-look-l .pup-head-n, .pup.is-look-r .pup-head-n, .pup-btn:hover .pup-head-n { opacity: 0; }
  .pup.is-look-l .pup-head-l, .pup.is-look-r .pup-head-r, .pup-btn:hover .pup-head-r { opacity: 1; }
}

/* ---------- Breakpoints ---------- */
@media (min-width: 560px) {
  .talks { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .shell { padding-top: 6rem; }
  .photo { width: 10.5rem; }
  .name { font-size: 3.6rem; }
}
@media (min-width: 1440px) {
  html { font-size: 106.25%; }
}
@media (max-width: 400px) {
  .top-bar { top: .75rem; right: .75rem; }
  .sticker { right: -2.6rem; font-size: 1.2rem; }
}
