:root {
  --bg: #f0ead6;
  --bg-2: #e4dcc3;
  --ink: #1d3a3b;
  --muted: #5f7774;
  --line: #d3c8ab;
  --teal: #0e4d4f;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Home ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.photo { position: relative; background: var(--bg-2); overflow: hidden; }
.photo picture, .photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.photo img {
  object-fit: cover;
  object-position: 50% 55%;
  animation: reveal 1.6s ease-out both;
}
.photo figcaption {
  position: absolute; left: 1.5rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  font-size: .8rem; color: rgba(255,255,255,.9);
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.text {
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(4rem + env(safe-area-inset-top, 0px)) clamp(1.5rem, 6vw, 6rem) calc(3rem + env(safe-area-inset-bottom, 0px));
  max-width: 44rem;
}
.name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: .95;
  letter-spacing: -0.02em;
}
.name span { display: block; font-style: italic; color: var(--teal); }
.bio {
  margin-top: 2rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.65;
  max-width: 30rem;
}
.actions { margin-top: 1.75rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-weight: 500;
  padding: .7rem 1.1rem .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s;
}
.pill:hover { background: var(--teal); color: var(--bg); border-color: var(--teal); }
.pill svg { width: 1.15rem; height: 1.15rem; }
.text-link {
  font-weight: 500; text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color .2s;
}
.text-link:hover { border-color: var(--teal); }
.home-foot { margin-top: 3rem; font-size: .8rem; color: var(--muted); }

@keyframes reveal { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .photo img { animation: none; } }

@media (max-width: 820px) {
  .page { grid-template-columns: 1fr; }
  .photo { height: 72vh; height: 72svh; order: -1; }
  .photo img { object-position: 50% 60%; }
  .text { padding-top: 2.5rem; }
}

/* ---------- Shared top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: baseline;
  max-width: 46rem; margin: 0 auto;
  padding: calc(1.75rem + env(safe-area-inset-top, 0px)) 1.5rem 0;
  font-size: .95rem;
}
.topbar a { text-decoration: none; color: var(--muted); }
.topbar a:hover { color: var(--ink); }
.topbar .home-link { font-family: var(--serif); font-style: italic; color: var(--teal); font-size: 1.1rem; }

/* ---------- Journal list ---------- */
.list { max-width: 46rem; margin: 0 auto; padding: 4rem 1.5rem 5rem; }
.list h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.5rem, 7vw, 4rem); letter-spacing: -0.02em;
  margin-bottom: 2rem;
}
.entries { list-style: none; border-top: 1px solid var(--line); }
.entries li { border-bottom: 1px solid var(--line); }
.entries a {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  align-items: center; gap: 1rem;
  padding: 1.1rem 0;
  text-decoration: none;
}
.entries time { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-title { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; transition: color .2s; }
.entries a:hover .entry-title { color: var(--teal); }
.entries em { font-size: .8rem; color: var(--muted); font-family: var(--sans); }
.entries img { width: 72px; height: 72px; object-fit: cover; border-radius: 3px; }
.empty { color: var(--muted); }
@media (max-width: 560px) {
  .entries a { grid-template-columns: 1fr auto; row-gap: .25rem; }
  .entries time { grid-column: 1; grid-row: 1; }
  .entry-title { grid-column: 1; grid-row: 2; }
  .entries img { grid-column: 2; grid-row: 1 / span 2; width: 60px; height: 60px; }
}

/* ---------- Post ---------- */
.post { padding-bottom: 4rem; }
.post-cover { max-width: 60rem; margin: 2rem auto 0; padding: 0 1.5rem; }
.post-cover img { width: 100%; max-height: 80vh; object-fit: cover; border-radius: 3px; }
.post-head { max-width: 38rem; margin: 3rem auto 0; padding: 0 1.5rem; }
.post-head time { font-size: .9rem; color: var(--muted); }
.post-head h1 {
  margin-top: .5rem;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08; letter-spacing: -0.015em;
}
.draft-note { margin-top: 1rem; font-size: .85rem; color: #8a5a1a; }
.prose { max-width: 38rem; margin: 2.5rem auto 0; padding: 0 1.5rem; font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-weight: 400; font-size: 1.6rem; line-height: 1.25; margin-top: 2.2em; }
.prose h3 { font-weight: 400; font-style: italic; font-size: 1.3rem; margin-top: 1.8em; }
.prose a { color: var(--teal); text-underline-offset: 3px; }
.prose blockquote {
  border-left: 4px solid var(--teal);
  padding: .2rem 0 .2rem 1.5rem;
  margin: 2em 0;
  font-size: 1.3rem; line-height: 1.6;
  color: var(--ink);
}
.prose blockquote p + p { margin-top: .8em; }
.prose blockquote cite, .prose blockquote p:last-child:has(> cite) {
  display: block; font-style: normal; font-family: var(--sans); font-size: .85rem; color: var(--muted);
}
/* Citação de destaque: centrada e maior */
.prose .pullquote {
  border: 0; padding: 0; margin: 2.5em auto;
  text-align: center; font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.35;
  font-style: italic; font-weight: 300; color: var(--teal);
  max-width: 32rem;
}
.prose .pullquote::before, .prose .pullquote::after {
  content: ""; display: block; width: 2.5rem; height: 1px; background: var(--line); margin: 0 auto 1.2rem;
}
.prose .pullquote::after { margin: 1.2rem auto 0; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .4em; }
.prose code { font-size: .9em; background: var(--bg-2); padding: .1em .35em; border-radius: 3px; }
.prose pre { background: var(--bg-2); padding: 1rem; border-radius: 4px; overflow-x: auto; font-size: .9rem; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
/* fotos no meio do texto saem mais largas que a coluna */
.prose p:has(> img), .prose p:has(> picture) {
  width: min(56rem, 100vw - 3rem);
  margin-left: 50%; transform: translateX(-50%);
  margin-top: 2em; margin-bottom: 2em;
}
.prose p > img, .prose p > picture img { width: auto; max-width: 100%; max-height: 85vh; margin: 0 auto; border-radius: 3px; }
.prose p:has(> img) + p > em:only-child, .prose p:has(> picture) + p > em:only-child {
  display: block; margin-top: -1.5em; font-size: .9rem; color: var(--muted); text-align: center;
}
.site-foot { max-width: 38rem; margin: 0 auto; padding: 0 1.5rem 4rem; }
.site-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-foot a:hover { color: var(--ink); }

/* ---------- Currently (leitura + carteira) ---------- */
.now {
  display: flex; flex-wrap: wrap; gap: .75rem 2.5rem;
  max-width: 38rem; margin: 0 auto 2.5rem; padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
}
.now-item { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: .75rem; row-gap: .35rem; }
.now-label { grid-column: 1 / -1; font-size: .7rem; letter-spacing: .02em; opacity: .8; }
.now-value { color: var(--ink); opacity: .75; }
.now-value em { font-family: var(--serif); font-size: .9rem; }
.now-sub { margin-left: .5rem; opacity: .7; }
.now .up { color: var(--teal); }
.now .down { color: #9a4b2f; }
.now-bar { display: block; width: 44px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.now-bar span { display: block; height: 100%; background: var(--teal); opacity: .7; }
.now-spark { width: 56px; height: 16px; }
.now-spark path { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .8; }

/* Em ecrãs largos sai para a margem esquerda e fica fixo, discreto */
@media (min-width: 1400px) {
  .now {
    position: fixed; left: 2rem; bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column; gap: 1.5rem;
    width: 11rem; margin: 0; padding: 0; border: 0;
    opacity: .55; transition: opacity .3s;
  }
  .now:hover { opacity: 1; }
  .now-item { grid-template-columns: 1fr; }
  .now-sub { display: block; margin: .15rem 0 0; }
  .now-bar { width: 100%; }
  .now-spark { width: 100%; height: 18px; }
}
