/* ============================================
   Daily AI Toolkit — Stylesheet
   Aesthetic: Warm editorial with playful accents
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ---------- Tokens ---------- */
:root {
  --bg: #F8F4ED;
  --bg-card: #FFFBF4;
  --bg-deep: #EFE9DE;
  --ink: #1A1A1A;
  --ink-soft: #4A4540;
  --ink-mute: #8A8278;
  --rule: #E3DCCE;
  --accent: #D2603E;
  --accent-deep: #B04E2F;
  --green: #5C8068;
  --highlight: #F4D35E;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 0 rgba(26, 26, 26, 0.04), 0 2px 6px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 2px 0 rgba(26, 26, 26, 0.04), 0 8px 24px rgba(26, 26, 26, 0.06);

  --maxw: 1100px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(at 8% 12%, rgba(210, 96, 62, 0.04) 0px, transparent 50%),
    radial-gradient(at 92% 88%, rgba(92, 128, 104, 0.05) 0px, transparent 50%);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-deep); }
button { font-family: inherit; cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.55rem); }
h4 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1.1em; color: var(--ink-soft); }
.lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38ch;
}
em.italic-display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--accent);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 4rem 0; }
@media (min-width: 768px) { .section { padding: 6rem 0; } }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 244, 237, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.brand .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  top: -1px;
}
.brand span { color: var(--accent); font-style: italic; }
nav.primary { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
nav.primary a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color .15s ease;
}
nav.primary a:hover { color: var(--accent); }
.nav-toggle { display: none; }
@media (max-width: 640px) {
  nav.primary { display: none; }
  nav.primary.open { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); padding: 1rem 1.5rem; border-bottom: 1px solid var(--rule); }
  .nav-toggle { display: inline-flex; background: transparent; border: 0; padding: 0.4rem; color: var(--ink); font-size: 1.4rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) { .hero { padding: 7rem 0 4rem; } }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  max-width: 18ch;
}
.hero .lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 48ch; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.hero-actions { margin-top: 2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--sans);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: white; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--bg); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Tool grid (homepage) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all .2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(210, 96, 62, 0.06));
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.tool-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tool-card:hover::before { opacity: 1; }
.tool-card .icon {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  filter: grayscale(0.1);
}
.tool-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--ink);
}
.tool-card p {
  font-size: 0.92rem;
  color: var(--ink-mute);
  margin: 0;
}
.tool-card .arrow {
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap .15s ease;
}
.tool-card:hover .arrow { gap: 0.7rem; }

/* ---------- Tool page (interactive) ---------- */
.tool-page { padding: 2.5rem 0 4rem; }
.tool-page .back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-mute);
  margin-bottom: 1.5rem;
}
.tool-page .back:hover { color: var(--accent); }
.tool-page h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.5rem; }
.tool-page .tool-intro {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

.tool-card-main {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) { .tool-card-main { padding: 2.25rem; } }

.tool-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.tool-form textarea,
.tool-form input[type="text"],
.tool-form select {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tool-form textarea { min-height: 140px; }
.tool-form textarea:focus,
.tool-form input:focus,
.tool-form select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.06);
}
.tool-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.tool-controls .options { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

.output-area {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--rule);
  display: none;
}
.output-area.visible { display: block; }
.output-area h4 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.output-content {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--ink);
  min-height: 80px;
}
.output-content.loading {
  color: var(--ink-mute);
  font-style: italic;
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
}
.copy-btn:hover { border-color: var(--ink); color: var(--ink); }
.copy-btn.copied { background: var(--green); color: white; border-color: var(--green); }

.error-msg {
  background: rgba(210, 96, 62, 0.08);
  border: 1px solid rgba(210, 96, 62, 0.3);
  color: var(--accent-deep);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin-top: 1rem;
}

/* Loading dots */
.dots span {
  display: inline-block;
  animation: blink 1.4s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ---------- Content blocks (article, faq, etc.) ---------- */
.content-block { max-width: 720px; margin: 0 auto; }
.content-block h2 { margin-top: 2.5rem; }
.content-block h3 { margin-top: 1.75rem; }
.content-block ul, .content-block ol {
  color: var(--ink-soft);
  padding-left: 1.25rem;
  margin-bottom: 1.1em;
}
.content-block li { margin-bottom: 0.4em; }
.content-block blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4em 0 0.4em 1.2em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 1.75em 0;
}
.content-block code {
  background: var(--bg-deep);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* FAQ */
.faq details {
  border-top: 1px solid var(--rule);
  padding: 1.1rem 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 400;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 0.75rem; color: var(--ink-soft); }

/* Related tools */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.related-tools .tool-card { padding: 1.1rem; }
.related-tools .tool-card h3 { font-size: 1.05rem; }
.related-tools .tool-card p { font-size: 0.85rem; }

/* ---------- Featured strip (homepage) ---------- */
.featured-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 3rem 0;
}
@media (min-width: 768px) { .featured-strip { grid-template-columns: repeat(3, 1fr); } }
.featured-strip > div {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 768px) {
  .featured-strip > div { border-bottom: 0; border-right: 1px solid var(--rule); }
  .featured-strip > div:last-child { border-right: 0; }
}
.featured-strip > div:last-child { border-bottom: 0; }
.featured-strip .num {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
}
.featured-strip .label { font-size: 0.9rem; color: var(--ink-mute); margin: 0; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 2.5rem 0;
  padding: 1rem;
  text-align: center;
  background: var(--bg-deep);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink-mute);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.site-footer .container { padding: 0 1.5rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-grid h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { color: rgba(248, 244, 237, 0.7); font-size: 0.95rem; }
.footer-grid a:hover { color: var(--bg); }
.footer-grid .brand { color: var(--bg); margin-bottom: 0.75rem; display: block; }
.footer-grid .brand span { color: var(--accent); }
.footer-grid .tagline { color: rgba(248, 244, 237, 0.6); font-size: 0.95rem; max-width: 28ch; }
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(248, 244, 237, 0.12);
  font-size: 0.85rem;
  color: rgba(248, 244, 237, 0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.mt-5 { margin-top: 4rem; }
.muted { color: var(--ink-mute); }
.small { font-size: 0.9rem; }

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeIn .5s ease both; }
  .stagger > * { animation: fadeIn .5s ease both; }
  .stagger > *:nth-child(2) { animation-delay: .05s; }
  .stagger > *:nth-child(3) { animation-delay: .1s; }
  .stagger > *:nth-child(4) { animation-delay: .15s; }
  .stagger > *:nth-child(5) { animation-delay: .2s; }
  .stagger > *:nth-child(6) { animation-delay: .25s; }
  .stagger > *:nth-child(7) { animation-delay: .3s; }
  .stagger > *:nth-child(8) { animation-delay: .35s; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}
.ad-slot { display: none !important; }