/* ==========================================================================
   RepeatText.com — "Inkwell" design system
   A hand-built, paper-and-ink workshop aesthetic. No stock SaaS blue,
   no borrowed templates — hard-edged cards, stamped headings, mono output.
   ========================================================================== */

:root {
  --paper: #F7F2E9;
  --paper-raised: #FFFDF8;
  --ink: #1C1A17;
  --ink-soft: #4A453D;
  --ink-faint: #8A8377;
  --line: #1C1A17;
  --accent: #E8542A;      /* burnt coral - primary action */
  --accent-ink: #FFF7F2;
  --moss: #4C6B4F;        /* secondary accent - success/highlights */
  --mustard: #E3AF2F;     /* tertiary accent - badges/tags */
  --shadow-hard: 5px 5px 0 var(--ink);
  --shadow-hard-sm: 3px 3px 0 var(--ink);
  --shadow-hard-lg: 8px 8px 0 var(--ink);
  --radius: 3px;
  --font-head: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  background-image:
    radial-gradient(var(--ink-faint) 0.6px, transparent 0.6px);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

header {
  background: var(--paper-raised);
  border-bottom: 3px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.logo {
  font-family: var(--font-head);
  font-weight: 700; font-size: 1.55rem; color: var(--ink);
  letter-spacing: -0.02em;
  padding: 4px 10px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  background: var(--paper-raised);
  transform: rotate(-1deg);
  display: inline-block;
}
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  color: var(--ink); font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: var(--radius);
  border: 2px solid transparent;
}
.nav-links a:hover { text-decoration: none; border-color: var(--ink); background: var(--paper); }
.mobile-menu-btn {
  display: none; background: var(--paper-raised); border: 2.5px solid var(--ink);
  border-radius: var(--radius); font-size: 1.3rem; cursor: pointer; color: var(--ink);
  width: 42px; height: 42px; box-shadow: var(--shadow-hard-sm);
}

/* Hero */
.hero {
  text-align: center; padding: 64px 20px 56px;
  background:
    linear-gradient(180deg, rgba(232,84,42,0.06), transparent 60%);
  border-bottom: 3px solid var(--line);
  position: relative;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: 2.6rem; margin-bottom: 16px; color: var(--ink);
  letter-spacing: -0.01em; line-height: 1.15;
}
.hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 620px; margin: 0 auto; }

/* Grid */
.section { padding: 54px 0; }
.section-title {
  font-family: var(--font-head);
  font-size: 1.9rem; margin-bottom: 32px; text-align: center; color: var(--ink);
  position: relative; display: block;
}
.section-title::after {
  content: ""; display: block; width: 56px; height: 4px; background: var(--accent);
  margin: 14px auto 0; border-radius: 2px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 26px; }

/* Cards — hard shadow, offset on hover, subtle alternating tilt */
.card {
  background: var(--paper-raised);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column;
}
.card:nth-child(3n+1) { transform: rotate(-0.4deg); }
.card:nth-child(3n+2) { transform: rotate(0.3deg); }
.card:nth-child(3n) { transform: rotate(-0.2deg); }
.card:hover {
  transform: translate(-3px, -3px) rotate(0deg);
  box-shadow: var(--shadow-hard-lg);
}
.card h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 10px; color: var(--ink); }
.card p { color: var(--ink-soft); margin-bottom: 22px; flex-grow: 1; font-size: 0.95rem; }
.card-btn {
  display: inline-block; padding: 10px 16px; background: var(--ink); color: var(--paper-raised);
  font-weight: 700; font-size: 0.9rem; border-radius: var(--radius); text-align: center;
  border: 2px solid var(--ink); text-transform: uppercase; letter-spacing: 0.03em;
}
.card-btn:hover { background: var(--accent); border-color: var(--ink); text-decoration: none; }

/* Breadcrumb */
.breadcrumb { padding: 18px 0; color: var(--ink-faint); font-size: 0.88rem; font-family: var(--font-mono); }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb span { margin: 0 8px; color: var(--ink-faint); }

/* Tool page layout */
.tool-page-layout { display: grid; grid-template-columns: 1fr 300px; gap: 36px; margin-top: 10px; }
.main-content {
  background: var(--paper-raised); padding: 34px;
  border-radius: var(--radius); border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-hard-lg);
}
.sidebar { }

/* Forms & tools */
.tool-box { margin: 28px 0; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.form-control {
  width: 100%; padding: 12px 14px; border: 2px solid var(--ink);
  border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.95rem;
  background: var(--paper); resize: vertical; color: var(--ink);
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 3px 3px 0 var(--accent);
}
textarea.form-control { min-height: 120px; }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  padding: 11px 22px; border: 2.5px solid var(--ink); border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 700; cursor: pointer; text-transform: uppercase;
  letter-spacing: 0.03em; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; box-shadow: var(--shadow-hard-sm); transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d4491f; }
.btn-secondary { background: var(--paper-raised); color: var(--ink); }
.btn-secondary:hover { background: var(--paper); }
.btn-success { background: var(--moss); color: #fff; border-color: var(--ink); }

.output-box {
  margin-top: 28px; padding: 20px; background: var(--paper);
  border: 2px dashed var(--ink); border-radius: var(--radius); position: relative;
}
.output-content { white-space: pre-wrap; word-break: break-all; min-height: 60px; font-family: var(--font-mono); font-size: 0.92rem; }
.output-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }

/* Content formatting */
.content-section { margin-top: 46px; }
.content-section h2 {
  font-family: var(--font-head); margin: 34px 0 14px; font-size: 1.55rem; color: var(--ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
.content-section h3 { margin: 22px 0 10px; font-size: 1.15rem; color: var(--ink); }
.content-section p { margin-bottom: 15px; color: var(--ink-soft); }
.content-section ul, .content-section ol { margin-bottom: 15px; padding-left: 22px; color: var(--ink-soft); }
.content-section li { margin-bottom: 8px; }
.content-section strong { color: var(--ink); }

/* FAQ */
.faq-item { border: 2px solid var(--ink); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: var(--paper-raised); }
.faq-question {
  padding: 15px 18px; background: var(--paper-raised); cursor: pointer; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head);
}
.faq-question:after { content: '＋'; font-size: 1.1rem; color: var(--accent); transition: transform 0.3s; }
.faq-item.active .faq-question:after { transform: rotate(135deg); }
.faq-item.active .faq-question { border-bottom: 2px solid var(--ink); }
.faq-answer { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; background: var(--paper); color: var(--ink-soft); }
.faq-item.active .faq-answer { padding: 15px 18px; max-height: 500px; }

/* Ads — styled as labeled "sponsor slot", not a generic grey box */
.ad-container {
  background: repeating-linear-gradient(45deg, var(--paper), var(--paper) 10px, #efe8d8 10px, #efe8d8 20px);
  border: 2px dashed var(--ink-faint);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 0.78rem; font-family: var(--font-mono);
  margin: 22px 0; overflow: hidden; text-transform: uppercase; letter-spacing: 0.05em;
}
.ad-horizontal { width: 100%; height: 90px; }
.ad-rectangle { width: 300px; height: 250px; margin: 22px auto; }

/* Footer */
footer { background: var(--ink); color: var(--paper); padding: 60px 0 30px; margin-top: 64px; border-top: 3px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: 18px; color: #fff; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #C8C1B3; }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 28px; border-top: 1px solid #45403A; color: #8A8377; font-size: 0.85rem; font-family: var(--font-mono); }

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.d-none { display: none !important; }

/* Responsive */
@media (max-width: 992px) {
  .tool-page-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--paper-raised); flex-direction: column; padding: 16px;
    border-bottom: 3px solid var(--ink);
  }
  .nav-links.active { display: flex; }
  .mobile-menu-btn { display: block; }
  .hero h1 { font-size: 1.9rem; }
  .card:nth-child(n) { transform: none; }
}
