/* ---------------------------------------------------------------------------
   sclearn.app

   Committed to one dark look rather than following the system theme. A marketing
   site is a statement about what the thing is; a legal page that flips to white
   in the middle of the same visit reads like two different companies.

   The palette is the app's, pushed further: the app has to stay quiet behind
   study content, a website does not.
   --------------------------------------------------------------------------- */

:root {
  /* Ground — a green-black, never neutral #000. */
  --ground: #0a0f0d;
  --ground-raised: #111917;
  --ground-high: #18231f;

  /* Ink — warm off-white so it sits on green without going blue. */
  --ink: #edf3ef;
  --ink-soft: #b3c2ba;
  --ink-dim: #7d8d85;

  --line: #1f2c27;
  --line-bright: #2d3e37;

  /* One green, three jobs: glow, fill, deep. */
  --green: #55c78d;
  --green-bright: #7ee0ad;
  --green-deep: #0f4a2f;
  --green-wash: rgba(85, 199, 141, 0.09);

  --display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  --measure: 34rem;
  --page: 68rem;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  /* A single wash behind the fold, so the top of the page is not flat black. */
  background-image: radial-gradient(
    120% 70% at 50% -20%,
    rgba(85, 199, 141, 0.12),
    transparent 60%
  );
  background-repeat: no-repeat;
}

.shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 25px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .mark {
  /* The viewBox carries padding, so the drawn mark is ~58% of this box. Sized to
     match the cap height of the 25px serif beside it, not the box. */
  width: 32px;
  height: 32px;
  margin-left: -4px;
  flex: none;
}

.masthead nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.masthead nav a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.18s ease;
}

.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  color: var(--ink);
}

/* --------------------------------------------------------------------- type */

h1,
h2,
h3 {
  font-weight: 400;
  margin: 0;
}

.display {
  font-family: var(--display);
  font-size: clamp(2.9rem, 7.5vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.display em {
  font-style: italic;
  color: var(--green);
}

.lede {
  font-size: clamp(1.06rem, 2.1vw, 1.28rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 30rem;
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 18px;
}

a {
  color: var(--green);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-bright);
}

/* --------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0 96px;
}

.hero-copy {
  min-width: 0;
}

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.formats li {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  padding: 5px 13px;
}

/* --------------------------------------------------------- the flashcard demo

   A real card that flips, rather than a screenshot of one. It is the whole
   product in a single gesture, and it explains the app faster than the
   paragraph next to it does. */

.card-stage {
  position: relative;
  perspective: 1400px;
  display: grid;
  place-items: center;
  min-height: 340px;
}

.flashcard {
  position: relative;
  /* Above the two stacked edges drawn behind it. */
  z-index: 1;
  width: min(330px, 100%);
  aspect-ratio: 5 / 6;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.flashcard.is-flipped {
  transform: rotateY(180deg);
}

.flashcard:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 14px;
  border-radius: var(--radius);
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line-bright);
  background: var(--ground-raised);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px -24px rgba(0, 0, 0, 0.9);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.face--back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, var(--green-deep), #0c3a24);
  border-color: rgba(126, 224, 173, 0.28);
}

.face .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.face--back .tag {
  color: var(--green-bright);
}

.face .body {
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.face .hint {
  font-size: 13px;
  color: var(--ink-dim);
}

.face--back .hint {
  color: rgba(237, 243, 239, 0.6);
}

/* Two stacked edges behind the card, so it reads as a deck rather than a box. */
.card-stage::before,
.card-stage::after {
  content: '';
  position: absolute;
  width: min(330px, 78%);
  aspect-ratio: 5 / 6;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--ground-raised);
}

.card-stage::before {
  transform: translateY(14px) scale(0.955);
  opacity: 0.7;
}

.card-stage::after {
  transform: translateY(27px) scale(0.91);
  opacity: 0.4;
}

/* -------------------------------------------------------------------- steps */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 40px;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  background: var(--ground);
  padding: 30px 26px 34px;
}

.step .num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--green);
  display: block;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.12rem;
  margin-bottom: 8px;
  letter-spacing: -0.005em;
  font-weight: 600;
}

.step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 44rem;
}

.plan {
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--ground-raised);
}

.plan--pro {
  border-color: rgba(85, 199, 141, 0.42);
  background: linear-gradient(170deg, var(--green-wash), transparent 70%), var(--ground-raised);
}

.plan .name {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.plan--pro .name {
  color: var(--green);
}

.plan .price {
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 14px 0 4px;
}

.plan .price span {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-dim);
}

.plan ul {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.plan li {
  padding-left: 22px;
  position: relative;
  margin-bottom: 9px;
}

.plan li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
}

.footnote {
  color: var(--ink-dim);
  font-size: 14px;
  margin-top: 20px;
  max-width: var(--measure);
}

/* ------------------------------------------------------------- long-form doc */

.doc {
  padding: 24px 0 40px;
  max-width: 40rem;
}

.doc h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.doc .meta {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 32px;
}

.doc .lead {
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--ink-soft);
  padding-bottom: 8px;
}

.doc h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 52px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.doc h3 {
  font-size: 1.04rem;
  font-weight: 600;
  margin: 30px 0 8px;
  color: var(--ink);
}

.doc p,
.doc li {
  color: var(--ink-soft);
}

.doc strong {
  color: var(--ink);
  font-weight: 600;
}

.doc ul {
  padding-left: 20px;
}

.doc li {
  margin-bottom: 10px;
}

.doc li::marker {
  color: var(--green);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.doc th,
.doc td {
  text-align: left;
  padding: 13px 14px 13px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}

.doc th {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 400;
}

.doc td:first-child {
  color: var(--ink);
  white-space: nowrap;
  padding-right: 20px;
}

.card {
  background: var(--ground-raised);
  border: 1px solid var(--line-bright);
  border-left: 2px solid var(--green);
  border-radius: 4px var(--radius) var(--radius) 4px;
  padding: 22px 24px;
  margin: 28px 0;
}

.card.accent {
  background: linear-gradient(120deg, var(--green-wash), transparent 80%), var(--ground-raised);
}

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

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

/* ------------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 40px 0 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-dim);
  font-size: 14.5px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--green);
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 32px 0 72px;
  }
  .card-stage {
    order: -1;
    min-height: 0;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .plans {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .shell {
    padding: 0 20px;
  }
  .masthead nav {
    gap: 16px;
    font-size: 14px;
  }
  .section {
    padding: 56px 0;
  }
  /* The one thing that cannot reflow; let it scroll rather than crush. */
  .doc table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .doc td:first-child {
    padding-right: 16px;
  }
}
