/* Cabinet Grotesk & Switzer by Indian Type Foundry, self-hosted from Fontshare (free license). */
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("fonts/cabinet-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("fonts/cabinet-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette sampled from the Textwerk app icon's own gradient (hue ~297),
     not a stock swatch, tuned in OKLCH so lightness steps stay even. */
  --accent: oklch(48% 0.19 297);
  --accent-dark: oklch(40% 0.17 297);
  --ink: oklch(20% 0.012 297);
  --gray: oklch(50% 0.018 297);
  --faint: oklch(54% 0.02 297);
  --tint: oklch(97% 0.006 297);
  --hairline: color-mix(in oklch, var(--ink) 9%, transparent);
  --radius: 12px;
  --font-display: "Cabinet Grotesk", ui-rounded, -apple-system, sans-serif;
  --font-body: "Switzer", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

::selection { background: color-mix(in oklch, var(--accent) 18%, transparent); }

img { max-width: 100%; }

.wrap { max-width: 980px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.wrap--narrow { max-width: 720px; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; font-weight: 700; margin: 0; }

.lead, .section-lead { color: var(--gray); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 32px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.nav__links { display: flex; align-items: center; gap: 30px; font-size: 14px; }
.nav__links a { color: var(--gray); }
.nav__links a:hover { color: var(--ink); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav { position: relative; flex-wrap: wrap; }
  .nav__toggle { display: flex; }
  .nav__links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 4px 32px 12px;
    background: #fff;
    border-bottom: 1px solid var(--hairline);
  }
  .nav--open .nav__links { display: flex; }
  .nav__links a {
    padding: 14px 0;
    font-size: 16px;
    border-top: 1px solid var(--hairline);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
}
.btn--primary { padding: 13px 28px; background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--sm { padding: 11px 22px; font-size: 15px; }
.btn--text { color: var(--accent); }

/* Hero */
.hero { max-width: 820px; margin: 0 auto; padding: 100px 32px 56px; text-align: center; }
.hero__icon { display: block; width: 120px; height: 120px; margin: 0 auto 32px; }
.hero h1 { font-size: clamp(2.5rem, 6vw + 1rem, 4.75rem); line-height: 1.06; letter-spacing: -0.02em; }
.hero .lead { max-width: 560px; margin: 26px auto 0; font-size: 21px; line-height: 1.48; }

@media (max-width: 480px) {
  .hero__break { display: none; }
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 36px; }
.hero__note { margin-top: 20px; font-size: 13px; color: var(--faint); }

/* Screenshot */
.shot { max-width: 1080px; margin: 0 auto; padding: 24px 32px 80px; }
.shot img {
  display: block;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 30px 80px rgba(0, 0, 0, 0.12);
}

/* Zoomable screenshots + lightbox */
.zoomable {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
}
.zoomable img { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.zoomable:hover img, .zoomable:focus-visible img { transform: scale(1.015); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: color-mix(in oklch, var(--ink) 90%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: color-mix(in oklch, white 14%, transparent);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { background: color-mix(in oklch, white 24%, transparent); }

/* Features */
.features { border-top: 1px solid var(--hairline); }
.features .wrap { padding-top: 96px; padding-bottom: 96px; }
.features h2 { font-size: 44px; line-height: 1.08; margin-bottom: 8px; max-width: 560px; }
.features .section-lead { font-size: 19px; max-width: 520px; }
.features__groups {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-top: 64px;
}
.feature-group__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 24px;
}
.feature-group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px 48px;
}
.feature h4 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.005em; margin: 0 0 8px; }
.feature p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--gray); }
.feature code { font-size: 0.85em; }

/* Look */
.look {
  background: var(--tint);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 96px 0;
  text-align: center;
}
.look__intro h2 { font-size: 44px; line-height: 1.08; margin-bottom: 8px; }
.look__intro .section-lead { font-size: 19px; max-width: 480px; margin: 0 auto 56px; }
.style-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 40px;
  background: color-mix(in oklch, var(--ink) 6%, transparent);
  border-radius: 999px;
}
.style-toggle__btn {
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  background: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--gray);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.style-toggle__btn:hover { color: var(--ink); }
.style-toggle__btn.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.look__hero {
  display: block;
  width: calc(100% - 64px);
  max-width: 880px;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 30px 80px rgba(0, 0, 0, 0.24);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 64px;
  text-align: left;
}
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 16px 44px rgba(0, 0, 0, 0.12);
}
.gallery figcaption { margin-top: 16px; font-size: 15.5px; line-height: 1.5; color: var(--gray); }
.gallery figcaption strong { color: var(--ink); font-weight: 600; }

/* Fork / changelog */
.fork .wrap { padding-top: 96px; padding-bottom: 96px; }
.fork h2 { font-size: 40px; line-height: 1.1; margin-bottom: 20px; }
.fork .section-lead { font-size: 19px; line-height: 1.55; margin: 0 0 44px; }
.changes { margin: 0; }
.change {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--hairline);
}
.change dt { font-size: 15px; font-weight: 600; color: var(--ink); }
.change dd { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--gray); }

@media (max-width: 560px) {
  .change { grid-template-columns: 1fr; gap: 4px; }
}

/* Install */
.install { background: var(--tint); border-top: 1px solid var(--hairline); }
.install .wrap { padding-top: 96px; padding-bottom: 96px; }
.install__title { font-size: 44px; line-height: 1.08; text-align: center; margin-bottom: 8px; }
.install__lead { font-size: 19px; max-width: 440px; margin: 0 auto 52px; text-align: center; }
.steps { display: flex; flex-direction: column; gap: 32px; }
.step h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 6px; }
.step p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.55; color: var(--gray); }
.step__note { margin: -6px 0 0; font-size: 13.5px; color: var(--faint); }
.step--divider { padding-top: 8px; border-top: 1px solid var(--hairline); }
.step--divider h3 { margin-top: 20px; }

code { font-family: var(--mono); font-size: 0.9em; }
.step p code { font-size: 14px; color: var(--ink); }
.code {
  position: relative;
  margin: 0 0 14px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
}
.code pre {
  margin: 0;
  padding: 16px 90px 16px 18px;
  overflow-x: auto;
  color: var(--tint);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  user-select: all;
  -webkit-user-select: all;
}
.code code { font-size: 13px; color: inherit; }
.code__copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: color-mix(in oklch, white 16%, transparent);
  color: var(--tint);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.code__copy:hover { background: color-mix(in oklch, white 26%, transparent); }

/* Footer */
.footer { padding: 48px 0 64px; }
.footer__row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.footer__links { display: flex; gap: 24px; font-size: 14px; }
.footer__links a { color: var(--gray); }
.footer__links a:hover { color: var(--ink); }
.footer__note {
  margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.footer__legal {
  margin: 14px auto 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--faint);
}

@media (max-width: 640px) {
  .hero { padding-top: 64px; }
  .hero .lead { font-size: 18px; }
  .features h2, .look__intro h2, .install__title { font-size: 32px; }
  .fork h2 { font-size: 30px; }
  .nav__links { gap: 18px; }
}
