/* ============================================================
   CUENTO — Fine-line Ink & Sketch Landing Page
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:   #0d0d0d;
  --paper: #f5f2ec;
  --font-hand: 'Caveat', cursive;
  --font-type: 'Special Elite', cursive;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-type);
  font-size: 18px;
  line-height: 1.7;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

a { color: inherit; text-decoration: none; }

/* ── SVG Filters — very subtle, fine-pen quality ─────────── */
/*  scale:0.6 + high baseFrequency = tight micro-wobble only  */

/* ── Buttons ──────────────────────────────────────────────── */
.btn-sketch {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.55em 1.6em;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  /* hand-drawn border via SVG background */
  background-clip: padding-box;
  transition: transform 0.15s;
}

/* SVG inline border — looks like drawn in one stroke */
.btn-sketch::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='1' y='1' width='calc(100%25 - 2px)' height='calc(100%25 - 2px)' fill='none' stroke='%230d0d0d' stroke-width='1.5' stroke-dasharray='4 1.5 300 0' stroke-linecap='round'/%3E%3C/svg%3E");
  pointer-events: none;
}

.btn-primary  { background: var(--ink); color: var(--paper); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-small    { font-size: 0.95rem; padding: 0.3em 1em; }
.btn-large    { font-size: 1.4rem; padding: 0.7em 2em; }

.btn-sketch:hover { transform: translate(-2px, -2px); }
.btn-primary:hover  { box-shadow:  3px 3px 0 var(--ink); }
.btn-secondary:hover { box-shadow: 3px 3px 0 var(--ink); }

/* Outlined style — drawn rectangle */
.btn-sketch.btn-secondary {
  outline: none;
  border: none;
  box-shadow: none;
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: var(--paper);
  /* single fine ruled line */
  border-bottom: 1px solid var(--ink);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-hand);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: inherit;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  transform: rotate(-8deg);
  transition: transform 0.3s ease;
}

.nav-logo:hover .nav-logo-img {
  transform: rotate(-4deg) scale(1.06);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a:not(.btn-sketch) {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  position: relative;
}

/* underline drawn with dashes — like penciling under text */
.nav-links a:not(.btn-sketch)::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 0;
  border-bottom: 1px dashed var(--ink);
  transition: width 0.2s;
}
.nav-links a:not(.btn-sketch):hover::after { width: 100%; }

.nav-lang {
  opacity: 0.45;
  font-size: 0.95rem !important;
  letter-spacing: 0.08em;
}
.nav-lang:hover { opacity: 1; }

/* ── Section labels ───────────────────────────────────────── */
.section-label {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-hand);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 2.5rem 4rem;
  position: relative;
  overflow: hidden;
}

/* fine hatching lines in corner — like margin doodles */
.hero::before {
  content: '';
  position: absolute;
  top: 80px; right: 0;
  width: 320px; height: 320px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Ccircle cx='160' cy='160' r='155' fill='none' stroke='%230d0d0d' stroke-width='0.75' stroke-dasharray='3 5' opacity='0.12'/%3E%3Ccircle cx='160' cy='160' r='130' fill='none' stroke='%230d0d0d' stroke-width='0.5' stroke-dasharray='2 6' opacity='0.07'/%3E%3C/svg%3E");
  transform: translate(20%, -10%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-text {
  flex: 1;
  max-width: 560px;
}

.hero-eyebrow {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  opacity: 0.45;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-hand);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.75;
  margin-bottom: 2.5rem;
  max-width: 460px;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}


/* Hero image */
.hero-image {
  flex-shrink: 0;
  width: 420px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.hero-scroll-hint {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  opacity: 0.35;
  text-align: center;
  margin-top: 4rem;
  letter-spacing: 0.1em;
  animation: bob 2.5s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* ── Section dividers — ruled lines ───────────────────────── */
.about, .features, .how, .oss {
  border-top: 1px solid rgba(13,13,13,0.25);
}

/* ── About ────────────────────────────────────────────────── */
.about { padding: 6rem 0; }

.about-text {
  font-size: 1.2rem;
  line-height: 1.85;
  max-width: 680px;
  opacity: 0.82;
}

/* ── Features ─────────────────────────────────────────────── */
.features { padding: 6rem 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
  margin-top: 3rem;
}

.feature-card {
  padding: 2rem 1.75rem;
  position: relative;
  background: var(--paper);
  transition: transform 0.2s;
}

/* SVG-drawn border — single fine ink stroke */
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0.75' y='0.75' width='calc(100%25 - 1.5px)' height='calc(100%25 - 1.5px)' fill='none' stroke='%230d0d0d' stroke-width='1' rx='0'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* offset hatched shadow — like pencil shading */
.feature-card::after {
  content: '';
  position: absolute;
  top: 5px; left: 5px;
  right: -5px; bottom: -5px;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='url(%23hatch)' opacity='0.18'/%3E%3Cdefs%3E%3Cpattern id='hatch' patternUnits='userSpaceOnUse' width='5' height='5' patternTransform='rotate(45)'%3E%3Cline x1='0' y1='0' x2='0' y2='5' stroke='%230d0d0d' stroke-width='0.75'/%3E%3C/pattern%3E%3C/defs%3E%3C/svg%3E");
}

.feature-card:hover {
  transform: translate(-3px, -3px);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  display: block;
  filter: grayscale(1);
}

.feature-card h3 {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.95rem;
  line-height: 1.65;
  opacity: 0.7;
}

/* ── Feature tabs ─────────────────────────────────────────── */
.features-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.tab-btn {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--paper);
  border: none;
  cursor: pointer;
  padding: 0.55rem 1.25rem;
  position: relative;
  color: var(--ink);
  transition: transform 0.15s;
}

.tab-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0.75' y='0.75' width='calc(100%25 - 1.5px)' height='calc(100%25 - 1.5px)' fill='none' stroke='%230d0d0d' stroke-width='1' rx='0'/%3E%3C/svg%3E");
  pointer-events: none;
}

.tab-btn::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  right: -4px; bottom: -4px;
  z-index: -1;
  background: transparent;
  transition: background 0.15s;
}

.tab-btn:hover {
  transform: translate(-2px, -2px);
}

.tab-btn:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='url(%23hatch)' opacity='0.12'/%3E%3Cdefs%3E%3Cpattern id='hatch' patternUnits='userSpaceOnUse' width='5' height='5' patternTransform='rotate(45)'%3E%3Cline x1='0' y1='0' x2='0' y2='5' stroke='%230d0d0d' stroke-width='0.75'/%3E%3C/pattern%3E%3C/defs%3E%3C/svg%3E");
}

.tab-btn.active {
  background: var(--ink);
  color: var(--paper);
  transform: translate(-2px, -2px);
}

.tab-btn.active::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='url(%23hatch2)' opacity='0.18'/%3E%3Cdefs%3E%3Cpattern id='hatch2' patternUnits='userSpaceOnUse' width='5' height='5' patternTransform='rotate(45)'%3E%3Cline x1='0' y1='0' x2='0' y2='5' stroke='%230d0d0d' stroke-width='0.75'/%3E%3C/pattern%3E%3C/defs%3E%3C/svg%3E");
}

.features-panel {
  display: none;
}

.features-panel.active {
  display: block;
}

/* ── How it works ─────────────────────────────────────────── */
.how { padding: 6rem 0; }

.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-num {
  font-family: var(--font-hand);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.1;
}

.step-body h3 {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.step-body p {
  font-size: 0.95rem;
  line-height: 1.65;
  opacity: 0.7;
}

/* connecting line between steps — single ruled stroke */
.step-line {
  flex: 0 0 auto;
  width: 48px;
  height: 1px;
  background: none;
  border-top: 1px dashed rgba(13,13,13,0.3);
  margin-top: 1.9rem;
  align-self: flex-start;
}

/* ── Open Source ──────────────────────────────────────────── */
.oss { padding: 6rem 0; }

.oss-inner {
  display: flex;
  gap: 5rem;
  align-items: center;
  flex-wrap: wrap;
}

.oss-text { flex: 1; min-width: 280px; }

.oss-text p {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.78;
  margin-bottom: 2rem;
  max-width: 480px;
}

.oss-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.oss-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; gap: 0.1rem; }

.stat-val {
  font-family: var(--font-hand);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-family: var(--font-hand);
  font-size: 0.8rem;
  opacity: 0.45;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* terminal doodle box */
.oss-doodle { flex: 0 0 auto; }

.doodle-box {
  padding: 2rem 2.5rem;
  position: relative;
  transform: rotate(1deg);
}

/* fine-pen drawn border on the terminal box */
.doodle-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='1' y='1' width='calc(100%25 - 2px)' height='calc(100%25 - 2px)' fill='none' stroke='%230d0d0d' stroke-width='1.25'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* hatched shadow */
.doodle-box::after {
  content: '';
  position: absolute;
  top: 6px; left: 6px;
  right: -6px; bottom: -6px;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='url(%23hatch2)'/%3E%3Cdefs%3E%3Cpattern id='hatch2' patternUnits='userSpaceOnUse' width='5' height='5' patternTransform='rotate(45)'%3E%3Cline x1='0' y1='0' x2='0' y2='5' stroke='%230d0d0d' stroke-width='0.6'/%3E%3C/pattern%3E%3C/defs%3E%3C/svg%3E");
  opacity: 0.14;
}

/* terminal dots */
.doodle-box-dots {
  font-size: 0.55rem;
  letter-spacing: 0.35em;
  opacity: 0.3;
  display: block;
  margin-bottom: 1rem;
}

.code-sketch {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 2.1;
  white-space: pre;
  opacity: 0.88;
}

/* ── CTA ──────────────────────────────────────────────────── */
.cta {
  padding: 7rem 0;
  border-top: 1px solid rgba(13,13,13,0.25);
  text-align: center;
}

.cta .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.cta-logo {
  width: 80px;
  height: auto;
  opacity: 0.12;
  transform: rotate(5deg);
  margin-bottom: 0.5rem;
}

.cta h2 {
  font-family: var(--font-hand);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
}

.cta p {
  font-size: 1rem;
  opacity: 0.6;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid rgba(13,13,13,0.25);
  padding: 2rem 2.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-family: var(--font-hand);
  font-size: 1rem;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.footer-links a:hover { opacity: 1; }

.footer-copy {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  opacity: 0.38;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0.85rem 1.25rem; }
  .nav-links a:not(.btn-sketch) { display: none; }

  .hero { padding: 6rem 1.25rem 3rem; }
  .hero-inner { flex-direction: column-reverse; text-align: center; }
  .hero-image { width: 280px; }
  .hero-actions { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero::before { display: none; }

  .steps { flex-direction: column; gap: 2.5rem; }
  .step-line { width: 1px; height: 28px; border-top: none; border-left: 1px dashed rgba(13,13,13,0.3); margin: 0; }

  .oss-inner { flex-direction: column; gap: 3rem; }
  .doodle-box { transform: none; }

  .footer-inner { justify-content: center; text-align: center; flex-direction: column; }
}
