/* ===================================================================
   Web.RocaServer — design system v3
   "Escritorio de estudio": editorial, cálido, dibujado a mano —
   deliberadamente distinto de la estética "IA SaaS" (oscuro + neón + cristal)
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,500;0,600;0,700;0,900;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6efe2;
  --bg-panel: #fffcf5;
  --bg-panel-2: #fbf4e6;
  --ink: #2a231c;
  --ink-soft: #5c5146;
  --ink-faint: #8a7c6c;
  --line: #e3d5bd;
  --line-strong: #cdb996;
  --terracotta: #bf5b30;
  --terracotta-dark: #9c4622;
  --forest: #33513f;
  --forest-light: #4d7059;
  --gold: #b6842a;
  --cream-on-terracotta: #fbf1e6;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 22px;
  --max-width: 720px;
  --wide: 1080px;
  --shadow-sm: 0 2px 10px -4px rgba(42, 35, 28, 0.14);
  --shadow: 0 18px 40px -18px rgba(42, 35, 28, 0.28);
  font-size: 17px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* subtle paper grain — texture, not color blobs */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

a { color: var(--terracotta-dark); text-decoration: underline; text-decoration-color: rgba(191, 91, 48, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

code {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.9em;
}

svg.icon { width: 1em; height: 1em; }

/* ---------- reveal-on-scroll (short, subtle) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-1 { transition-delay: .05s; }
.reveal-2 { transition-delay: .11s; }
.reveal-3 { transition-delay: .17s; }
.reveal-4 { transition-delay: .23s; }

/* ---------- header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 239, 226, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink) !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand::before {
  content: "";
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--terracotta);
  flex-shrink: 0;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.2 2'/%3E%3C/svg%3E");
  mask-size: 70%;
  mask-repeat: no-repeat;
  mask-position: center;
  background-color: var(--terracotta);
}
.brand span { color: var(--terracotta-dark); font-style: italic; }
.site-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft) !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--ink) !important; background: var(--bg-panel-2); }
.site-nav a.cta {
  background: var(--terracotta);
  color: var(--cream-on-terracotta) !important;
  font-weight: 600;
}
.site-nav a.cta:hover { background: var(--terracotta-dark); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-panel);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle:hover { background: var(--bg-panel-2); }

/* ---------- layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 90px;
}
main.wide { max-width: var(--wide); }
main.tool { max-width: var(--wide); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 60px 24px 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; padding-top: 76px; gap: 40px; }
  .hero-copy { text-align: left; }
  .hero-actions { justify-content: flex-start !important; }
  .eyebrow { margin-left: 0 !important; }
}
.hero-copy { text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--terracotta-dark);
  margin: 0 auto 14px;
  position: relative;
}
.eyebrow .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terracotta);
  flex-shrink: 0;
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(191, 91, 48, 0.35); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 5px rgba(191, 91, 48, 0); }
}
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.15rem);
  margin: 0 auto 18px;
}
.hero h1 em {
  font-style: italic;
  color: var(--terracotta);
}
.hero p.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 30px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-art { display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 380px; height: auto; }
.hero-art .art-float { animation: art-bob 4.5s ease-in-out infinite; transform-origin: center; }
.hero-art .art-float-slow { animation: art-bob 6s ease-in-out infinite; animation-delay: -1.5s; transform-origin: center; }
@keyframes art-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero-art .art-steam path {
  animation: art-steam-rise 2.6s ease-in-out infinite;
  transform-origin: center;
}
.hero-art .art-steam path:nth-child(2) { animation-delay: 0.5s; }
@keyframes art-steam-rise {
  0% { opacity: 0; transform: translateY(4px); }
  35% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art .art-float, .hero-art .art-float-slow, .hero-art .art-steam path, .eyebrow .dot {
    animation: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  font-family: "Inter", sans-serif;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  text-decoration: none !important;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--terracotta);
  color: var(--cream-on-terracotta) !important;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--terracotta-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  color: var(--ink) !important;
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-panel-2); border-color: var(--ink-faint); }

/* ---------- card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 44px 0;
}
.card-grid.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
  text-decoration: none !important;
  color: var(--ink);
  display: block;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--terracotta-dark);
}
.card .icon svg { width: 19px; height: 19px; }
.card h3 { font-size: 1.1rem; margin-bottom: 7px; color: var(--ink); font-weight: 600; }
.card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.card.tool-card {
  border-color: var(--terracotta);
  background: var(--bg-panel);
  box-shadow: var(--shadow-sm);
}
.card.tool-card:hover { box-shadow: var(--shadow); }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cream-on-terracotta);
  background: var(--terracotta);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---------- section ---------- */
.section { max-width: var(--wide); margin: 0 auto; padding: 20px 24px 60px; }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
.section-head p { color: var(--ink-soft); }

/* ---------- article prose ---------- */
main.article h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.meta { color: var(--ink-faint); font-size: 0.9rem; margin-top: -10px; }
.ad-slot {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 30px 0;
  background: var(--bg-panel-2);
}
table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .02em; }
.callout {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 26px 0;
}

/* ---------- pomodoro tool ---------- */
.tool-hero { text-align: center; padding: 20px 0 10px; }
.timer-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  max-width: 980px;
  margin: 26px auto 0;
}
@media (min-width: 860px) {
  .timer-wrap { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}
.timer-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px 30px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.mode-tabs {
  display: inline-flex;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 28px;
}
.mode-tab {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}
.mode-tab.active { background: var(--terracotta); color: var(--cream-on-terracotta); }

.ring-wrap { position: relative; width: 250px; height: 250px; margin: 0 auto 28px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.ring-fg {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-time {
  font-family: "Fraunces", serif;
  font-size: 2.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.ring-label { color: var(--ink-faint); font-size: 0.82rem; margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; }

.timer-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.icon-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-panel);
  color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s, border-color .15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { transform: translateY(-2px); border-color: var(--ink-faint); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.primary {
  width: 64px; height: 64px;
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--cream-on-terracotta);
  box-shadow: var(--shadow-sm);
}
.icon-btn.primary svg { width: 22px; height: 22px; }
.icon-btn.primary:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); }
.icon-btn .icon-pause { display: none; }
.icon-btn.is-running .icon-play { display: none; }
.icon-btn.is-running .icon-pause { display: block; }

.interval-row { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; color: var(--ink-soft); font-size: 0.84rem; }
.interval-row label { display: flex; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.stepper button {
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: var(--bg-panel); color: var(--ink); cursor: pointer; font-weight: 700;
  border: 1px solid var(--line);
}
.stepper span { min-width: 20px; text-align: center; font-weight: 600; color: var(--ink); }

.side-col { display: flex; flex-direction: column; gap: 18px; }
.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.stat-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 13px; }
.stat-row:last-child { margin-bottom: 0; }
.stat-num { font-family: "Fraunces", serif; font-size: 1.55rem; font-weight: 600; color: var(--terracotta-dark); }
.stat-label { color: var(--ink-soft); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 15px; height: 15px; color: var(--gold); }

.plant-box { text-align: center; padding: 8px 0 2px; }
.plant-box svg { width: 110px; height: 110px; }
.hidden { display: none !important; }
.plant-caption { color: var(--ink-soft); font-size: 0.85rem; margin-top: 4px; }

.week-bars { display: flex; align-items: flex-end; gap: 7px; height: 64px; margin-top: 10px; }
.week-bars .bar { flex: 1; background: var(--bg-panel-2); border: 1px solid var(--line); border-radius: 5px 5px 2px 2px; position: relative; min-height: 4px; transition: height .5s ease; }
.week-bars .bar.filled { background: var(--terracotta); border-color: var(--terracotta); }
.week-labels { display: flex; gap: 7px; margin-top: 6px; }
.week-labels span { flex: 1; text-align: center; font-size: 0.7rem; color: var(--ink-faint); }

.sound-toggle { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 40px; height: 23px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--bg-panel-2); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; transition: background .2s; }
.switch .track::before { content: ""; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px; background: var(--ink-faint); border-radius: 50%; transition: transform .2s, background .2s; }
.switch input:checked + .track { background: var(--terracotta); border-color: var(--terracotta); }
.switch input:checked + .track::before { transform: translateX(17px); background: var(--cream-on-terracotta); }

/* ---------- how-it-works numbered icon ---------- */
.step-num {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: var(--terracotta-dark);
}

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 30px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.footer-inner a { color: var(--ink-soft) !important; text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-inner { justify-content: space-between; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 10px 16px 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .25s ease, opacity .2s ease;
  }
  .site-nav.is-open { max-height: 400px; opacity: 1; }
  .site-nav a { padding: 13px 14px; border-radius: 10px; }
  .site-nav a.cta { text-align: center; }
}
