/* Grammafold — brand-aligned static site */

:root {
  --brand-fold: #6B4FA0;
  --brand-fold-hover: #5A3F8F;
  --icon-purple-deep: #7B3FE4;
  --icon-purple-surface: #945CFF;
  --icon-accent-yellow: #FFC526;
  --icon-accent-green: #1BBF54;
  --warning-orange: #FF9500;
  --success-green: #34C759;

  --color-bg: #f5f5f7;
  --color-bg-elevated: #ffffff;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-text-tertiary: #86868b;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-strong: rgba(0, 0, 0, 0.15);
  --color-accent: var(--brand-fold);
  --color-accent-hover: var(--brand-fold-hover);
  --color-accent-tint: rgba(107, 79, 160, 0.12);
  --color-panel-bg: rgba(128, 128, 128, 0.12);

  --font-brand: 'Cabin', system-ui, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, monospace;

  --page-padding: 24px;
  --section-gap: 16px;
  --panel-radius: 8px;
  --panel-padding: 12px;
  --dropzone-radius: 12px;
  --button-radius: 7px;
  --max-width: 900px;
  --max-width-narrow: 760px;
  --header-height: 52px;
  --transition: 120ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-fold: #B9A4E0;
    --brand-fold-hover: #C9B8EA;
    --color-bg: #1c1c1e;
    --color-bg-elevated: #2c2c2e;
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #86868b;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-strong: rgba(255, 255, 255, 0.2);
    --color-accent-tint: rgba(185, 164, 224, 0.12);
    --color-panel-bg: rgba(128, 128, 128, 0.18);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand-fold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--page-padding);
  z-index: 200;
  padding: 8px 16px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--panel-radius);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* Wordmark */

.wordmark {
  font-family: var(--font-brand);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}

.wordmark--sm {
  font-size: 20px;
}

.wordmark__gramma {
  color: var(--color-text);
}

.wordmark__fold {
  color: var(--brand-fold);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: color-mix(in srgb, var(--color-bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--section-gap);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
}

.site-logo__icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.header-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.header-nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav__links a {
  color: var(--color-text-secondary);
  font-size: 14px;
  text-decoration: none;
}

.header-nav__links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.header-nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--button-radius);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  cursor: pointer;
}

.nav-toggle__icon {
  width: 18px;
  height: 18px;
}

.mobile-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 160px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--panel-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.mobile-nav-menu[hidden] {
  display: none;
}

.mobile-nav-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--color-text);
  font-size: 14px;
  text-decoration: none;
}

.mobile-nav-menu a:hover {
  background: var(--color-panel-bg);
  text-decoration: none;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  border-radius: var(--button-radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .btn--primary {
    background: var(--brand-fold);
    color: #1c1c1e;
  }

  .btn--primary:hover {
    background: var(--brand-fold-hover);
    color: #1c1c1e;
  }
}

.btn--secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.btn--secondary:hover {
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-bg-elevated));
  color: var(--color-text);
}

.btn--small {
  font-size: 14px;
  padding: 6px 12px;
}

.btn--disabled,
.btn--disabled:hover {
  background: var(--color-text-tertiary);
  color: #fff;
  cursor: default;
  pointer-events: none;
  opacity: 0.7;
}

/* Hero */

.hero {
  text-align: center;
  padding: 56px var(--page-padding) 64px;
}

.hero__icon {
  width: 128px;
  height: 128px;
  margin: 0 auto var(--section-gap);
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(123, 63, 228, 0.25);
}

.hero__wordmark {
  margin: 0 0 4px;
}

.hero__tagline {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 var(--section-gap);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero__value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0 auto 12px;
  max-width: 640px;
}

.hero__subhead {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 28px;
}

.hero__meta {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin: 0 0 28px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.hero__callout {
  max-width: 720px;
  margin: 40px auto 0;
}

.hero__screenshot {
  width: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  display: block;
}

/* Sections */

.section {
  padding: 64px var(--page-padding);
}

.section--alt {
  background: var(--color-bg-elevated);
}

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.section__lead {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 0 32px;
  line-height: 1.5;
}

.text-center {
  text-align: center;
}

.text-center .section__lead {
  margin-left: auto;
  margin-right: auto;
}

/* Panels */

.panel {
  background: var(--color-panel-bg);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
}

.panel--lg {
  padding: 24px;
}

.panel__label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 980px;
  margin-bottom: 16px;
}

.panel__label--before {
  background: rgba(255, 149, 0, 0.15);
  color: var(--warning-orange);
}

.panel__label--after {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success-green);
}

.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--section-gap);
}

@media (max-width: 768px) {
  .before-after {
    grid-template-columns: 1fr;
  }
}

.panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.panel__list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.panel__list li::before {
  content: "•";
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.folder-tree {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0;
  overflow-x: auto;
}

.folder-tree .folder {
  color: var(--brand-fold);
}

.folder-tree .date {
  color: var(--color-text-secondary);
}

/* Steps */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--section-gap);
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  padding: var(--panel-padding);
}

.step__number {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  width: 16px;
  display: inline-block;
  margin-bottom: 8px;
}

.step__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.step__text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Features grid */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--section-gap);
}

.feature-card {
  background: var(--color-panel-bg);
  border-radius: var(--panel-radius);
  padding: 20px var(--panel-padding);
}

.feature-card__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.feature-card__text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Formats */

.format-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--section-gap);
}

@media (max-width: 600px) {
  .format-columns {
    grid-template-columns: 1fr;
  }
}

.format-group__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-text);
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.format-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  background: var(--color-panel-bg);
  border-radius: 4px;
  color: var(--color-text-secondary);
}

/* Screenshots */

.screenshot {
  display: block;
  width: 100%;
  border-radius: var(--panel-radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  cursor: zoom-in;
}

.screenshot:focus-visible {
  outline: 2px solid var(--brand-fold);
  outline-offset: 4px;
}

.screenshot-caption {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.workflow-screenshots {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.screenshot--plain,
.screenshot--transparent,
.hero__screenshot {
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Screenshot lightbox */

.screenshot-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
  cursor: pointer;
}

.screenshot-modal[hidden] {
  display: none;
}

.screenshot-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.screenshot-modal__content {
  position: relative;
  z-index: 1;
  max-width: min(1200px, 100%);
  max-height: 100%;
}

.screenshot-modal__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 72px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--panel-radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.screenshot-modal__close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(28, 28, 30, 0.85);
  color: #fff;
  cursor: pointer;
}

.screenshot-modal__close:hover {
  background: rgba(44, 44, 46, 0.95);
}

.screenshot-modal__close-icon {
  width: 18px;
  height: 18px;
}

body.screenshot-modal-open {
  overflow: hidden;
}

.workflow-split {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.workflow-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.5fr);
  gap: 32px;
  align-items: start;
}

.workflow-step {
  padding: 0;
}

.workflow-step p:last-child {
  margin: 0;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.workflow-shot {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: center;
}

.workflow-shot--reverse {
  grid-template-columns: 1.4fr 1fr;
}

.workflow-shot--reverse .workflow-shot__text {
  order: 2;
}

.workflow-shot--reverse .workflow-shot__media {
  order: 1;
}

.workflow-shot__step {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-fold);
  margin: 0 0 8px;
}

.workflow-shot__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.workflow-shot__text p {
  margin: 0;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.before-after__shot {
  margin-top: 12px;
}

.before-after__shot .screenshot {
  border-radius: var(--panel-radius);
}

.workflow-screenshots--spaced {
  margin-top: 40px;
}

@media (max-width: 768px) {
  .workflow-row {
    grid-template-columns: 1fr;
  }

  .workflow-shot,
  .workflow-shot--reverse {
    grid-template-columns: 1fr;
  }

  .workflow-shot--reverse .workflow-shot__text,
  .workflow-shot--reverse .workflow-shot__media {
    order: unset;
  }
}

/* Mockup */

.mockup {
  margin-top: 32px;
  border-radius: var(--panel-radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.mockup__toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--color-panel-bg);
  border-bottom: 1px solid var(--color-border);
}

.mockup__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  opacity: 0.4;
}

.mockup__body {
  padding: var(--panel-padding);
  min-height: 200px;
}

.mockup__summary {
  background: var(--color-panel-bg);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
  margin-bottom: var(--section-gap);
  font-size: 14px;
  color: var(--color-text-secondary);
}

.mockup__summary strong {
  color: var(--color-text);
  font-family: var(--font-mono);
  font-weight: 600;
}

.mockup__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--panel-radius);
  color: var(--color-text-tertiary);
  font-size: 14px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px var(--page-padding);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav a {
  color: var(--color-text-secondary);
  font-size: 14px;
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.site-footer__meta {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 0;
  line-height: 1.6;
}

/* Subpages */

.page-header {
  text-align: center;
  padding: 48px var(--page-padding) 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.page-header__title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.page-header__subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.page-content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 40px var(--page-padding) 64px;
}

.page-content h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 40px 0 12px;
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.page-content p,
.page-content li {
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 16px;
}

.page-content ul,
.page-content ol {
  padding-left: 1.25em;
  margin: 0 0 16px;
}

.page-content li {
  margin-bottom: 6px;
}

.page-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-panel-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-panel-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* FAQ */

.page-content .faq-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  letter-spacing: -0.01em;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  color: var(--color-accent);
}

.faq-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 0 16px;
}

.faq-answer p {
  margin: 0;
}

/* Contact card */

.contact-card {
  background: var(--color-panel-bg);
  border-radius: var(--panel-radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 32px;
}

.contact-card p {
  margin: 0 0 8px;
}

.contact-card a {
  font-size: 17px;
  font-weight: 500;
}

/* Privacy highlights */

.privacy-highlights {
  background: var(--color-panel-bg);
  border-radius: var(--panel-radius);
  padding: 20px 24px;
  margin: 24px 0;
}

.privacy-highlights ul {
  margin: 0;
  padding-left: 1.25em;
}

.privacy-highlights li {
  margin-bottom: 8px;
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
}

.privacy-highlights li::marker {
  color: var(--success-green);
}

/* Utilities */

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

/* Responsive header */

@media (max-width: 734px) {
  .header-nav__links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    padding-top: 40px;
  }

  .wordmark {
    font-size: 28px;
  }

  .hero__value {
    font-size: 19px;
  }

  .section {
    padding: 48px var(--page-padding);
  }
}
