/* ==========================================================================
   Claude Watermark Remover — stylesheet

   Hand-written CSS, no build step. Replaces the Tailwind CDN so production
   serves one small static file instead of compiling utilities in the browser.

   Mobile-first. Two breakpoints, matching the old Tailwind ones:
     sm  = 640px
     lg  = 1024px
   ========================================================================== */

/* ---------- Design tokens ---------------------------------------------- */

:root {
  --paper: #FAFAF7;
  --ink: #1B1C1F;
  --inksoft: #5B5D63;
  --rule: #E1DFD6;
  --accent: #2F5D62;
  --accentsoft: #E7EFEE;
  --mark: #A6482F;

  /* Hairline dividers (--rule) stay light for the editorial look. Panel and
     input edges use --rule-strong, which meets the WCAG 1.4.11 3:1 minimum
     for the boundary of a form control: 3.18:1 against paper. */
  --rule-strong: #928D7C;

  /* Dedicated placeholder colour. Previously this was --inksoft at 60%
     opacity, which measured 2.56:1 against paper — below the 4.5:1 minimum
     for the page's primary empty-state instruction. */
  --placeholder: #6C6E74;

  --panel-frame: rgba(255, 255, 255, 0.6);
  --header-bg: rgba(250, 250, 247, 0.9);

  --success-bg: #F0FDF4;
  --success-fg: #15803D;
  --error-bg: #FEF2F2;
  --error-fg: #B91C1C;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --page-width: 72rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  --transition: color 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease;
}

/* ---------- Dark theme --------------------------------------------------
   Only the tokens are redefined; every rule below reads through them, so
   there is no duplicated layout or component CSS. Follows the reader's OS
   setting.
   ---------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15161A;
    --ink: #EDEBE5;
    --inksoft: #A5A7AE;
    --rule: #2B2D33;
    --rule-strong: #646872;
    --accent: #7FBAB6;
    --accentsoft: #1B2C2D;
    --mark: #E2946F;
    --placeholder: #8A8C93;

    --panel-frame: rgba(255, 255, 255, 0.035);
    --header-bg: rgba(21, 22, 26, 0.9);

    --success-bg: #12291D;
    --success-fg: #74DBA2;
    --error-bg: #2C1719;
    --error-fg: #F59A92;
  }

  /* The paper texture reads as pure black on some OLED screens; a hair of
     warmth keeps the editorial feel. */
  body {
    background-image: linear-gradient(rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0.012));
  }
}

/* ---------- Reset ------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
p {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font: inherit;
  color: inherit;
}

textarea {
  font-family: inherit;
}

/* Visible, consistent focus ring for keyboard users.

   Two-tone on purpose: a plain accent ring measured 2.32:1 against the dark
   buttons, so tabbing to "Try it now" was nearly invisible. The paper-coloured
   box-shadow sits between the element and the accent outline, so one of the
   two rings always contrasts with whatever is underneath it. */
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--paper);
}

/* ---------- Small utilities -------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 2rem;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.is-hidden {
  display: none !important;
}

.measure {
  max-width: 42rem;
}

/* ---------- Header / navigation ---------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.nav {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.nav__links {
  display: none;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  color: var(--inksoft);
}

.nav__links a:hover {
  color: var(--ink);
}

.nav__cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}

@media (min-width: 640px) {
  .nav__links {
    display: flex;
  }

  .nav__cta {
    display: none;
  }
}

/* ---------- Shared section furniture ----------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--mark);
  margin-bottom: 0.75rem;
}

.section {
  padding-block: 4rem;
  border-top: 1px solid var(--rule);
}

.section__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section__title--spaced {
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .section {
    padding-block: 5rem;
  }

  .section__title {
    font-size: 1.875rem;
  }
}

/* ---------- Hero -------------------------------------------------------- */

.hero {
  padding-top: 4rem;
  padding-bottom: 3.5rem;
}

.hero__inner {
  max-width: 48rem;
}

.hero .eyebrow {
  margin-bottom: 1.25rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.hero__lead {
  margin-top: 1.5rem;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--inksoft);
}

.hero__actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* The rule under "Keep your voice." */
.underline-mark {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 92%;
  background-repeat: no-repeat;
  background-size: 100% 3px;
}

@media (min-width: 640px) {
  .hero {
    padding-top: 6rem;
    padding-bottom: 5rem;
  }

  .hero__title {
    font-size: 3.75rem;
  }
}

/* ---------- Buttons and links ------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn--solid {
  background-color: var(--ink);
  color: var(--paper);
}

.btn--solid:hover {
  background-color: var(--accent);
}

.btn--accent {
  background-color: var(--accent);
  color: var(--paper);
}

.btn--accent:hover {
  background-color: var(--ink);
}

.btn--outline {
  background-color: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn--outline:hover {
  background-color: var(--ink);
  color: var(--paper);
}

.btn--outline:hover .btn__note {
  color: var(--paper);
}

.btn__note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--inksoft);
  transition: var(--transition);
}

/* Shown inside a button while a request is in flight. Inherits the button's
   text colour, so it works on both the outline and the accent button. */
.spinner {
  display: inline-block;
  flex: none;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinner-pulse {
  50% {
    opacity: 0.25;
  }
}

/* Rotation can be uncomfortable for motion-sensitive users, but the button
   still needs to show that work is happening — fade instead of spin. */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    border-top-color: currentColor;
    animation: spinner-pulse 1.4s ease-in-out infinite;
  }
}

.btn--accent .btn__note {
  color: inherit;
  opacity: 0.8;
}

.link-muted {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--inksoft);
}

.link-muted:hover {
  color: var(--ink);
}

/* Small text buttons inside panel headers (Clear / Copy). */
.tool-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--inksoft);
  transition: var(--transition);
}

.tool-btn:hover {
  color: var(--mark);
}

.tool-btn--accent:hover {
  color: var(--accent);
}

/* ---------- Editor ------------------------------------------------------ */

.editor {
  padding-bottom: 5rem;
}

.editor__frame {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background-color: var(--panel-frame);
  padding: 1rem;
}

.editor__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background-color: var(--paper);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.panel__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}

.panel__tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.panel__area {
  flex: 1;
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 0;
  background-color: transparent;
  padding: 0.75rem 1rem;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.panel__area::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.panel__counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--inksoft);
}

/* Text / Preview segmented toggle in the panel header. */
.seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 9999px;
  padding: 2px;
  background-color: var(--panel-frame);
}

.seg__btn {
  border: 0;
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--inksoft);
  cursor: pointer;
  transition: var(--transition);
}

.seg__btn:hover {
  color: var(--ink);
}

.seg__btn.is-active {
  background-color: var(--accent);
  color: var(--paper);
}

/* ---------- Rendered Markdown preview ----------------------------------- */

/* Mirrors .panel__area's box so switching views never shifts the layout. */
.panel__preview {
  flex: 1;
  min-height: 260px;
  max-height: 640px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  overflow-wrap: break-word;
}

.panel__preview:empty::before {
  content: attr(data-placeholder);
  color: var(--placeholder);
}

.panel__preview > *:first-child {
  margin-top: 0;
}

.panel__preview > *:last-child {
  margin-bottom: 0;
}

.panel__preview p {
  margin: 0 0 0.85em;
}

.panel__preview h2,
.panel__preview h3,
.panel__preview h4,
.panel__preview h5,
.panel__preview h6 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 1.4em 0 0.5em;
}

.panel__preview h2 {
  font-size: 1.35rem;
}

.panel__preview h3 {
  font-size: 1.15rem;
}

.panel__preview h4,
.panel__preview h5,
.panel__preview h6 {
  font-size: 1rem;
}

.panel__preview ul,
.panel__preview ol {
  margin: 0 0 0.85em;
  padding-left: 1.35rem;
}

.panel__preview li {
  margin-bottom: 0.3em;
}

.panel__preview li::marker {
  color: var(--mark);
}

.panel__preview blockquote {
  margin: 0 0 0.85em;
  padding-left: 0.9rem;
  border-left: 3px solid var(--rule);
  color: var(--inksoft);
}

.panel__preview a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.panel__preview code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--accentsoft);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.panel__preview pre {
  margin: 0 0 0.85em;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background-color: var(--panel-frame);
  overflow-x: auto;
}

.panel__preview pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
}

.panel__preview hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.4em 0;
}

.panel__preview strong {
  font-weight: 600;
}

/* Word count once the text exceeds the AI word cap. Clean Text still works,
   so this is a warning, not an error state. */
.panel__counts .is-over {
  color: var(--mark);
  font-weight: 500;
}

.editor__actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.editor__buttons {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
}

.usage {
  font-size: 0.875rem;
  color: var(--inksoft);
  text-align: center;
}

.usage__count {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
}

@media (min-width: 640px) {
  .editor__frame {
    padding: 1.5rem;
  }

  .editor__grid {
    gap: 1.5rem;
  }

  .panel__area,
  .panel__preview {
    min-height: 320px;
  }

  .editor__actions {
    margin-top: 1.5rem;
    flex-direction: row;
    align-items: center;
  }

  .editor__buttons {
    flex-direction: row;
  }

  .usage {
    text-align: right;
  }
}

@media (min-width: 1024px) {
  .editor__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Status / error banner --------------------------------------- */

.status {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.status--info {
  background-color: var(--accentsoft);
  color: var(--accent);
}

.status--success {
  background-color: var(--success-bg);
  color: var(--success-fg);
}

.status--error {
  background-color: var(--error-bg);
  color: var(--error-fg);
}

/* ---------- About ------------------------------------------------------- */

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.about__heading {
  max-width: 24rem;
}

.about__body {
  max-width: 42rem;
  color: var(--inksoft);
  line-height: 1.7;
}

@media (min-width: 1024px) {
  .about__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .about__body {
    grid-column: span 2;
  }
}

/* ---------- How it works ------------------------------------------------ */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.step {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}

.step__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mark);
}

.step__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0.5rem 0 0.375rem;
}

.step__text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--inksoft);
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* ---------- Feature cards ----------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.card__text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--inksoft);
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Transparency note ------------------------------------------- */

.note {
  color: var(--inksoft);
  line-height: 1.7;
}

/* ---------- Footer ------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--rule);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2.5rem;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-weight: 500;
}

.site-footer__tag {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--inksoft);
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--inksoft);
}

.site-footer__links a:hover {
  color: var(--ink);
}

.site-footer__copy {
  font-size: 0.75rem;
}

@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
  }
}
