/* Nicoli Lopes, Psicóloga: a carta */

@font-face { font-family: "Young Serif"; src: url("fonts/young-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-italic.woff2") format("woff2"); font-weight: 400 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --envelope: #ECC2B6;      /* nude rose stock, from her current site */
  --envelope-deep: #E2AE9F;
  --paper: #FFE8E8;         /* blush writing paper, from her current site */
  --paper-lift: #FFF3F1;
  --ink: #4A3B3B;           /* body text, deepened from her #5F4F4F */
  --ink-soft: #5F4F4F;
  --wine: #6E1F33;          /* wax seal and action ink */
  --wine-deep: #561626;
  --wine-note: #8A3348;     /* handwritten annotations */
  --rule: rgba(110, 31, 51, 0.2);
  --rule-strong: rgba(110, 31, 51, 0.42);

  --f-display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --f-text: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-hand: "Caveat", "Segoe Print", cursive;

  --measure: 62ch;
  --sheet-pad: clamp(1.25rem, 5vw, 4.5rem);
  --gap-section: clamp(4rem, 9vw, 7.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--wine) var(--envelope);
}

body {
  margin: 0;
  font-family: var(--f-text);
  font-size: 1.125rem;
  line-height: 1.68;
  color: var(--ink);
  background-color: var(--envelope);
  /* paper fibre */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.43 0 0 0 0 0.12 0 0 0 0 0.2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--envelope); }
::-webkit-scrollbar-thumb { background: var(--wine); border: 3px solid var(--envelope); border-radius: 8px; }

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--wine);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover { text-decoration-color: currentColor; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--wine); color: var(--paper); padding: 0.6rem 1rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* ---------- the desk and the sheet ---------- */

.desk { padding: clamp(0.75rem, 2.4vw, 2rem) clamp(0.5rem, 2.4vw, 2rem) 0; }

.sheet {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--paper);
  padding: 0 var(--sheet-pad) clamp(3rem, 7vw, 5.5rem);
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 2px 3px rgba(86, 22, 38, 0.06),
    0 18px 40px -18px rgba(86, 22, 38, 0.28),
    0 40px 80px -40px rgba(86, 22, 38, 0.22);
  animation: settle 1.1s var(--ease-out) both;
}

@keyframes settle {
  from { transform: translateY(14px) rotate(-0.35deg); }
  to { transform: none; }
}

/* ---------- letterhead ---------- */

.letterhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  padding: clamp(1.4rem, 3vw, 2.2rem) 0 1.1rem;
  border-bottom: 1px solid var(--rule-strong);
  position: relative;
}
.letterhead::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -5px;
  border-bottom: 1px solid var(--rule);
}

.mark { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--wine); line-height: 1; }
.mark__name {
  font-family: var(--f-hand);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.2vw, 2.9rem);
  letter-spacing: 0.005em;
  line-height: 0.95;
}
.mark__title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.45rem;
}

.letterhead__nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 1.6rem; font-size: 0.95rem; }
.letterhead__nav a { color: var(--ink); text-decoration: none; padding: 0.35rem 0; }
.letterhead__nav a:hover { color: var(--wine); text-decoration: underline; text-decoration-color: var(--rule-strong); }
.letterhead__nav .letterhead__wa {
  color: var(--paper);
  background: var(--wine);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}
.letterhead__nav .letterhead__wa:hover { background: var(--wine-deep); color: var(--paper); text-decoration: none; }

/* ---------- opening ---------- */

.opening {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(240px, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-top: clamp(2.2rem, 5vw, 3.6rem);
}


h1, h2 {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--wine);
  text-wrap: balance;
  letter-spacing: -0.012em;
}

h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  line-height: 1.04;
  margin: 0 0 1.4rem;
}

.lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.62; margin: 0 0 2.2rem; max-width: 58ch; }

/* ---------- the photograph held by corners ---------- */

.snapshot { margin: 0; justify-self: end; width: min(100%, 400px); transform: rotate(1.6deg); margin-top: 0.4rem; }
.snapshot__photo {
  position: relative;
  background: var(--paper-lift);
  padding: 12px 12px 14px;
  box-shadow: 0 2px 2px rgba(86, 22, 38, 0.08), 0 14px 28px -12px rgba(86, 22, 38, 0.35);
}
.snapshot__photo img { aspect-ratio: 1089 / 1300; object-fit: cover; object-position: 50% 0; width: 100%; }
.corner {
  position: absolute; width: 34px; height: 34px; z-index: 2;
  background: linear-gradient(135deg, var(--envelope-deep) 50%, transparent 50%);
  filter: drop-shadow(0 1px 1px rgba(86, 22, 38, 0.18));
}
.corner--tl { top: -6px; left: -6px; }
.corner--tr { top: -6px; right: -6px; transform: rotate(90deg); }
.corner--br { bottom: -6px; right: -6px; transform: rotate(180deg); }
.corner--bl { bottom: -6px; left: -6px; transform: rotate(270deg); }
.snapshot figcaption {
  font-family: var(--f-hand);
  font-size: 1.5rem;
  color: var(--wine-note);
  text-align: center;
  margin-top: 0.7rem;
  transform: rotate(-1.6deg);
}

/* ---------- reply card ---------- */

.reply {
  position: relative;
  max-width: 34rem;
  background: var(--envelope);
  border-radius: 4px;
  padding: 1.25rem 1.4rem 1.2rem;
  box-shadow: 0 1px 1px rgba(86, 22, 38, 0.08), 0 10px 22px -14px rgba(86, 22, 38, 0.4);
}
.reply::before {
  /* perforated edge */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 6px;
  background: radial-gradient(circle at 5px -1px, var(--paper) 3px, transparent 3.5px) 0 0 / 14px 6px repeat-x;
}
.reply__choice { border: 0; margin: 0 0 1rem; padding: 0 4.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.reply__choice legend { padding: 0; margin-bottom: 0.45rem; font-family: var(--f-display); font-size: 1.2rem; color: var(--ink); }
.reply__choice label { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; min-height: 44px; font-size: 1.02rem; }
.reply__choice input {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 1.3rem; height: 1.3rem; flex: none;
  border: 1.5px solid var(--wine); border-radius: 50%; background: var(--paper-lift);
  display: grid; place-items: center; cursor: pointer;
}
.reply__choice input::after {
  content: ""; width: 1.15rem; height: 1.15rem; background: var(--wine);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 3.5c4.2 3.6 8.6 8.4 13.6 13.2M16.4 2.8C11.8 7.4 7.6 11.6 3.4 16.9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='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 20 20'%3E%3Cpath d='M3 3.5c4.2 3.6 8.6 8.4 13.6 13.2M16.4 2.8C11.8 7.4 7.6 11.6 3.4 16.9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0) rotate(-12deg); transition: transform 0.25s var(--ease-out);
}
.reply__choice input:checked::after { transform: scale(1) rotate(-6deg); }
.reply__choice input:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.8rem 1.5rem;
  font: 600 1.05rem/1.2 var(--f-text);
  color: var(--paper); background: var(--wine);
  border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 18px -10px rgba(86, 22, 38, 0.7);
  transition: background-color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.btn:hover { background: var(--wine-deep); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 12px 22px -10px rgba(86, 22, 38, 0.75); }
.btn:active { transform: translateY(1px); }
.btn__icon { width: 1.25rem; height: 1.25rem; flex: none; }

.reply__note { margin: 0.75rem 0 0; font-size: 0.88rem; line-height: 1.45; color: var(--ink-soft); }

/* ---------- passages of the letter ---------- */

.passage {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(200px, 1fr);
  column-gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: var(--gap-section);
}
.passage > h2 { grid-column: 1; }
.passage__body { grid-column: 1; }

h2 { font-size: clamp(1.85rem, 3.2vw, 2.6rem); line-height: 1.12; margin: 0 0 1.3rem; }

.passage p { margin: 0 0 1.1rem; }

.margin-note {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--f-hand);
  font-size: clamp(1.55rem, 2.2vw, 1.85rem);
  line-height: 1.22;
  color: var(--wine-note);
  transform: rotate(-2.5deg);
  padding-left: 1.4rem;
  position: relative;
  max-width: 18rem;
}
.margin-note p { margin: 0; }
.margin-note::before {
  /* hand-drawn bracket */
  content: ""; position: absolute; left: 0; top: 0.2em; bottom: 0.2em; width: 0.6rem;
  border: 1.5px solid var(--wine-note); border-right: 0; border-radius: 10px 0 0 10px; opacity: 0.6;
}

.ruled { list-style: none; margin: 0.4rem 0 1.4rem; padding: 0; border-top: 1px solid var(--rule); }
.ruled li { padding: 0.75rem 0 0.75rem 1.6rem; border-bottom: 1px solid var(--rule); position: relative; }
.ruled li::before {
  content: ""; position: absolute; left: 0.15rem; top: 1.45rem; width: 0.65rem; height: 1px; background: var(--wine);
}

/* services */
.services { margin: 1.8rem 0 0; }
.service { padding: 1.6rem 0 1.7rem; border-top: 1px solid var(--rule-strong); scroll-margin-top: 1.5rem; }
.service:last-child { border-bottom: 1px solid var(--rule-strong); }
.service dt { font-family: var(--f-display); font-size: clamp(1.35rem, 2.2vw, 1.6rem); line-height: 1.2; margin: 0 0 0.6rem; }
.service dt a { color: var(--wine); text-decoration: none; }
.service dt a:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); }
.service dd { margin: 0; }
.service dd p { margin: 0 0 0.6rem; }
.service__meta { font-size: 0.98rem; color: var(--ink-soft); }
.service__meta::before { content: "Horários: "; font-weight: 600; color: var(--ink); }

.link-wa {
  display: inline-block;
  margin-top: 0.35rem; padding: 0.55rem 0;
  font-weight: 600; color: var(--wine);
  text-decoration: underline; text-decoration-color: var(--rule-strong);
}
.link-wa::after {
  content: ""; display: inline-block; width: 1rem; height: 1rem; margin-left: 0.4rem; vertical-align: -0.15em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4' fill='none' stroke='black' stroke-width='1.6' 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 16 16'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.25s var(--ease-out);
}
.link-wa:hover::after { transform: translateX(4px); }

/* signature */
.signoff { margin-top: 2rem !important; margin-bottom: 0 !important; font-style: italic; }
.signature {
  font-family: var(--f-hand); font-weight: 600; color: var(--wine);
  font-size: clamp(2.8rem, 5vw, 3.6rem); line-height: 1; margin: 0.2rem 0 0.3rem !important;
  transform: rotate(-2deg); transform-origin: left center;
}
.signature__title { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem !important; }
.ps { padding-top: 1.1rem; border-top: 1px dashed var(--rule-strong); }
.ps__label { font-family: var(--f-display); color: var(--wine); margin-right: 0.35rem; }

/* steps */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.2rem 3.2rem; margin: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 1.1rem; color: var(--wine);
  border: 1.5px solid var(--wine); border-radius: 50%;
}
.steps strong { color: var(--wine); font-weight: 600; }

/* ---------- envelope: where and when ---------- */

.envelope { max-width: 1180px; margin: clamp(-2.5rem, -4vw, -1.5rem) auto 0; position: relative; }
.envelope__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(4.5rem, 8vw, 6.5rem) var(--sheet-pad) clamp(2.5rem, 5vw, 4rem);
  background: var(--envelope-deep);
  border-radius: 3px;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.35) inset, 0 24px 50px -30px rgba(86, 22, 38, 0.45);
}
.envelope__inner::before {
  /* envelope flap folded open behind the letter */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(to bottom right, transparent 49.6%, rgba(86, 22, 38, 0.24) 50%, transparent 50.4%),
              linear-gradient(to bottom left, transparent 49.6%, rgba(86, 22, 38, 0.24) 50%, transparent 50.4%);
  background-size: 50% 100%; background-position: 0 0, 100% 0; background-repeat: no-repeat;
  pointer-events: none;
}

.envelope__title { margin-bottom: 1.6rem; }

.facts { margin: 0 0 2.4rem; display: grid; gap: 0; border-top: 1px solid var(--rule-strong); }
.facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--rule-strong); }
.facts dt { font-family: var(--f-hand); font-size: 1.55rem; line-height: 1.1; color: var(--wine); }
.facts dd { margin: 0; font-size: 1.02rem; line-height: 1.55; color: var(--ink); }
.facts a { font-weight: 600; }

.reply--card { background-color: var(--paper); max-width: none; }
.reply--card::before { background: radial-gradient(circle at 5px -1px, var(--envelope-deep) 3px, transparent 3.5px) 0 0 / 14px 6px repeat-x; }
.reply__send { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }

.seal {
  position: absolute; top: -0.9rem; right: 1rem;
  width: 4.4rem; height: 4.4rem;
  color: var(--wine);
  transform: rotate(-10deg);
}
.seal--closure { position: static; display: block; width: 3.6rem; height: 3.6rem; margin: -0.2rem 0 2rem; transform: rotate(8deg); }
.reply.is-sent .seal { animation: press 0.6s var(--ease-out); }
@keyframes press {
  0% { transform: rotate(-10deg) scale(1); }
  35% { transform: rotate(-6deg) scale(0.84); }
  100% { transform: rotate(-10deg) scale(1); }
}

.envelope__map { min-height: 360px; }
.envelope__map iframe {
  width: 100%; height: 100%; min-height: 360px; border: 0; display: block;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 0 0 10px var(--paper-lift), 0 18px 34px -16px rgba(86, 22, 38, 0.5);
  filter: sepia(0.18) saturate(0.85);
}

.colophon {
  text-align: center;
  padding: clamp(2.5rem, 5vw, 3.5rem) 1.25rem clamp(6rem, 10vw, 4rem);
  font-size: 0.95rem;
  color: var(--ink);
}
.colophon p { margin: 0 0 0.6rem; }
.colophon__mark { font-family: var(--f-hand); font-size: 2.2rem; font-weight: 600; color: var(--wine); line-height: 1; }
.colophon__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.3rem 1.6rem; margin-top: 0.9rem !important; }
.colophon__links a { font-weight: 600; display: inline-block; padding: 0.4rem 0; }
.colophon__care { max-width: 44rem; margin: 1.4rem auto 0 !important; font-size: 0.88rem; color: var(--ink); }

/* ---------- mobile dock ---------- */

.dock {
  position: fixed; left: 0.75rem; right: 0.75rem; bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: none; align-items: center; justify-content: center;
  min-height: 52px; border-radius: 999px;
  background: var(--wine); color: var(--paper); font-weight: 600; text-decoration: none;
  box-shadow: 0 10px 26px -8px rgba(54, 10, 22, 0.6);
  visibility: hidden; transform: translateY(160%);
  transition: transform 0.45s var(--ease-out), visibility 0s linear 0.45s;
}
.dock.is-visible { visibility: visible; transform: none; transition: transform 0.45s var(--ease-out), visibility 0s; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .opening { grid-template-columns: 1fr; }
  .snapshot { justify-self: center; order: -1; width: min(78%, 340px); margin: 0 auto 0.5rem; }
  .opening__text { order: 0; }
  .passage { grid-template-columns: 1fr; }
  .margin-note { grid-column: 1; grid-row: auto; margin: 0.6rem 0 0 0.4rem; max-width: 24rem; }
  .envelope__inner { grid-template-columns: 1fr; }
  .letterhead__nav a:not(.letterhead__wa) { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .desk { padding: 0.5rem 0.5rem 0; }
  .letterhead { align-items: center; flex-wrap: nowrap; padding-top: 1.1rem; gap: 0.75rem; }
  .wa-long { display: none; }
  .mark__name { font-size: 2.1rem; }
  .mark__title { font-size: 0.7rem; letter-spacing: 0.12em; }
  .letterhead__nav .letterhead__wa { padding: 0.5rem 0.85rem; font-size: 0.9rem; }
  .opening { padding-top: 1.6rem; gap: 1.6rem; }
  .snapshot { width: min(58%, 230px); }
  .snapshot figcaption { font-size: 1.25rem; margin-top: 0.4rem; }
  .reply { padding: 1.1rem 1.05rem 1rem; }
  .btn { width: 100%; }
  .reply__choice { padding-right: 3.4rem; }
  .seal { width: 3.6rem; height: 3.6rem; right: 0.6rem; top: -0.8rem; }
  .seal--closure { width: 3.2rem; height: 3.2rem; }
  .facts > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .envelope__map, .envelope__map iframe { min-height: 300px; }
  .dock { display: flex; }
}

@media (max-width: 359px) {
  .letterhead__nav .letterhead__wa { padding: 0.45rem 0.7rem; font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
