:root {
  color-scheme: light;
  --paper: #f8f8f3;
  --surface: #fff;
  --ink: #171e2d;
  --muted: #4e596a;
  --blue: #2349de;
  --blue-dark: #1935b0;
  --pale-blue: #e9eeff;
  --orange: #ff8745;
  --line: #d6dce4;
  --mono: ui-monospace, monospace;
}

* { box-sizing: border-box; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 system-ui, sans-serif;
}
main { flex: 1; }

a { color: inherit; text-underline-offset: .25em; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 32px);
  font-size: .94rem;
  font-weight: 650;
}

.bar a { text-decoration: none; }
.bar a:hover, .bar a[aria-current="page"], .quiet:hover { color: var(--blue); }
.brand { font-size: 1.62rem; line-height: 1; font-weight: 850; letter-spacing: -.075em; }
.brand span { color: var(--blue); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  padding-block: clamp(46px, 7vw, 92px);
}

h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { letter-spacing: -.058em; line-height: 1.03; }
h1 { font-size: clamp(3rem, 6.35vw, 5.65rem); font-weight: 850; }
h1 em { color: var(--blue); font-style: normal; white-space: nowrap; }
h2 { font-size: clamp(2.02rem, 4.15vw, 3.45rem); font-weight: 800; }
h3 { font-size: 1.34rem; line-height: 1.17; letter-spacing: -.04em; }

.label {
  margin-bottom: 13px;
  color: var(--blue-dark);
  font: 700 .75rem/1.4 var(--mono);
  letter-spacing: .08em;
}

.intro, .section p, .article section p { color: var(--muted); }
.intro {
  max-width: 40ch;
  margin-top: 19px;
  font-size: clamp(1.07rem, 1.8vw, 1.24rem);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px 23px;
  margin-top: 25px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-size: .94rem;
  font-weight: 750;
  text-decoration: none;
}
.button:hover, button:hover { background: var(--blue-dark); }
.outline { background: var(--surface); color: var(--blue-dark); }
.outline:hover { background: var(--pale-blue); }
.quiet { font-size: .94rem; font-weight: 680; text-decoration-thickness: 1px; }

.hero-art {
  position: relative;
  isolation: isolate;
  perspective: 1100px;
  min-width: 0;
  padding: clamp(11px, 2.1vw, 25px);
  border: 1px solid #cfd9fa;
  border-radius: 12px;
  background-color: #edf1ff;
  background-image: radial-gradient(#a9b8ed 1px, transparent 1px);
  background-size: 16px 16px;
}

.example {
  --playhead: 0%;
  --reel-progress: 0;
  position: relative;
  transform-style: preserve-3d;
  min-width: 0;
  border: 1px solid #243453;
  border-radius: 9px;
  background: #19243a;
  color: #f4f7ff;
  box-shadow: 0 9px 22px #1724412b;
}

figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid #39465e;
  font-size: .95rem;
}
.duration, .timecode {
  color: #beccee;
  font: 700 .73rem/1.4 var(--mono);
  white-space: nowrap;
}

.script { padding: clamp(14px, 2.1vw, 22px); }

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 2fr 2fr 1fr;
  gap: 3px;
  height: 20px;
  margin: 19px 0 12px;
}
.timeline span { border-radius: 2px; background-color: #8ea8ff; }
.timeline span:nth-child(even) { background-color: #5576e9; }
.timeline i {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: var(--playhead);
  width: 2px;
  background: var(--orange);
  box-shadow: 0 0 0 1px #19243a;
  transform: translateX(-50%);
}
.timeline i::before {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 8px;
  height: 6px;
  border-radius: 1px;
  background: inherit;
  content: "";
}

.beats, .modules { padding: 0; margin: 0; list-style: none; }
time, .shots strong { font-family: var(--mono); }
.beats time { color: #b7caff; }

.transport:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #39465e;
}
.playback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid #788ebd;
  background: #293a60;
  font-size: .83rem;
}
.playback:hover { background: #39568f; }
.playback:focus-visible { outline-color: var(--orange); }
.play-icon {
  width: 10px;
  height: 10px;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.is-playing .play-icon {
  clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
}

.section {
  padding-block: clamp(32px, 5.5vw, 66px);
  border-top: 1px solid var(--line);
}
.section .label { color: var(--blue-dark); }
.section h2 + p { margin-top: 12px; }

.measure { max-width: 57ch; }

.modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.modules li, .prompt {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.modules li { border-top: 3px solid var(--blue); }
.modules p { margin-top: 8px; }

footer.bar { border-top: 1px solid var(--line); border-bottom: 0; }
footer.bar > a:last-child { font-weight: 680; }

.article { max-width: 740px; padding-block: 35px 65px; }

.article h1 { font-size: clamp(2.9rem, 6vw, 4.95rem); }
.article h1 em { white-space: normal; }
.article .intro { max-width: 60ch; }
.article section {
  margin-block: 32px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}
.article h2 { margin-bottom: 12px; font-size: clamp(1.7rem, 4vw, 2.45rem); }
.prompt, .shots { margin-block: 16px; }
.prompt { background: var(--pale-blue); border-color: #cdd7ff; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.65 var(--mono); }
#copy-status:empty { display: none; }
button {
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}
.shots > div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.shots strong { color: var(--blue-dark); }
.skip {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 12px;
  padding: 8px;
  background: var(--paper);
  transform: translateY(-120%);
}
.skip:focus { transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy, .hero-art { animation: enter 600ms ease-out both; }
  .hero-art { animation-delay: 90ms; }
  .beats button { transition: background-color 150ms, border-color 150ms; }
  @keyframes enter {
    from { opacity: .4; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 760px) {
  .hero, .modules { grid-template-columns: 1fr; }
  .hero-art { width: min(100%, 500px); }
}

@media (max-width: 400px) {
  .wrap { width: calc(100% - 32px); }
  .bar { gap: 10px; }
  .bar nav { font-size: .85rem; }
}

/* Language controls */
[hidden] { display: none !important; }
.bar .primary { margin-left: auto; }
.bar .languages {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font: 750 .75rem/1 var(--mono);
}
.languages a { padding: 8px; border-radius: 3px; }
.languages a[aria-current="true"] { background: var(--blue); color: white; }
.bar .primary + .languages { margin-left: clamp(5px, 2vw, 25px); }
:lang(th) :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.22; }
:lang(th) .label { letter-spacing: 0; }
html[lang="th"] .hero h1 { font-size: clamp(2.65rem, 5.45vw, 4.9rem); }

/* Studio preview */
.hero-art {
  padding: clamp(13px, 2.6vw, 31px);
  border-color: #c3cdee;
  background-color: #ebeffb;
  background-image:
    linear-gradient(#b0bee759 1px, transparent 1px),
    linear-gradient(90deg, #b0bee759 1px, transparent 1px);
  background-size: 21px 21px;
  box-shadow: inset 0 0 45px #dce4fc;
}
.hero-art::before, .hero-art::after {
  position: absolute;
  z-index: -1;
  border-radius: 9px;
  content: "";
  pointer-events: none;
}
.hero-art::before {
  inset: 15% 7% 7% 15%;
  background: #b3c4ff;
  transform: translate(1.5%, 2%) rotate(6deg);
}
.hero-art::after {
  inset: 7% 15% 16% 6%;
  border: 1px solid #98a9df;
  transform: rotate(-7deg);
}
.example {
  transform: rotateX(4deg) rotateY(-5deg);
  box-shadow: 3px 3px 0 #314782, 6px 7px 0 #8198df, 10px 19px 28px #2d3b6c42;
}
.example figcaption {
  background: #243454;
  border-radius: 8px 8px 0 0;
}
.timeline { height: 26px; }
.timeline span {
  background-image: repeating-linear-gradient(90deg, #111e4c20 0 1px, transparent 1px 9px);
}
.timeline::after {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: #ffb47b;
  content: "";
  transform: scaleX(var(--reel-progress));
  transform-origin: left;
}
.timeline i { z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .example {
    transform: rotateX(calc(4deg + var(--tip-x, 0deg))) rotateY(calc(-5deg + var(--tip-y, 0deg)));
    transition: transform 210ms ease-out;
  }
  [data-reveal].in-view { animation: section-enter 620ms ease-out both; }
  .guide-card { transition: transform 180ms ease, box-shadow 180ms ease; }
  .guide-card:hover { transform: translateY(-4px); }
  @keyframes section-enter {
    from { opacity: .78; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .example { transform: none; }
}

/* Resource library and course */
.section-header, .course-header, .about {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 18px 30px;
}
.guide-search {
  display: grid;
  gap: 5px;
  width: min(100%, 265px);
}
.guide-search label { font-size: .85rem; color: var(--ink); font-weight: 700; }
.guide-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #a5afc1;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.guide-search input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.guide-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 10px;
  padding: clamp(17px, 2.5vw, 24px);
  border: 1px solid #ccd7f4;
  border-radius: 7px;
  background: var(--pale-blue);
  text-decoration: none;
}
.guide-card:nth-child(2) { border-color: #e9d2be; background: #fbebd9; }
.guide-card:nth-child(3) { border-color: #d1d8cf; background: #edf1e9; }
.guide-card:hover { box-shadow: 0 7px 14px #15265214; }
.guide-card .label { margin: 0 0 2px; }
.guide-card p { margin: 0 0 4px; }
.guide-link { margin-top: auto; color: var(--blue-dark); font-size: .9rem; font-weight: 730; }
.guide-card:hover .guide-link { text-decoration: underline; }
.no-guides { margin-top: 14px; }

.course {
  padding: clamp(22px, 4.6vw, 48px);
  border: 0;
  border-radius: 9px;
  background: #1b2845;
  color: #fff;
}
.course-header h1 { max-width: 16ch; }
.course-header .measure { flex: 0 1 29ch; }
.course p, .course .label { color: #d9e4ff; }
.course .modules li { border-color: #50618a; border-top-color: var(--orange); background: #263657; }
.about {
  align-items: center;
  padding: clamp(25px, 5vw, 52px);
  border: 1px solid #ccd7f4;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--pale-blue);
}
.about-copy { flex: 0 1 45ch; }
.about-copy .button, .about-copy .quiet { display: inline-flex; margin: 18px 12px 0 0; }
.standalone { padding-block: clamp(30px, 7vw, 84px); }
.guides-page .guides { padding-block: 0; border: 0; }
.guides-page .section-header h1 + p { margin-top: 12px; }
.standalone h1 { font-size: clamp(2.6rem, 5.6vw, 4.9rem); }
.course-page .course-header { align-items: start; }
.course-page .course-header .measure { align-self: end; }
.lesson-lead { margin-top: 29px; }
.article .mini-guide {
  padding: clamp(17px, 3vw, 27px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.mini-guide ul, .mini-guide ol { padding-inline-start: 1.25em; }
.mini-guide li + li { margin-top: 9px; }

@media (max-width: 760px) {
  .guide-list { grid-template-columns: 1fr; }
  .section-header { align-items: start; }
  .guide-search { width: min(100%, 360px); }
  .course-header .measure { flex-basis: auto; }
}
@media (max-width: 520px) {
  .bar:has(.languages) {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 8px;
    padding-block: 14px;
  }
  .bar .primary {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    gap: 17px;
  }
  .bar .primary + .languages { margin-left: 0; }
}

/* Featured editing project */
.hero h1 em { white-space: normal; }
.reel-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(9px, 1.6vw, 17px);
}
.reel-screen {
  position: relative;
  display: grid;
  place-items: stretch;
  min-width: 0;
  min-height: 218px;
  aspect-ratio: 3 / 4;
  border: 1px solid #7088c4;
  border-radius: 8px;
  background: #2a4ae1;
}
.reel-frame {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(9px, 1.65vw, 17px);
  border-radius: inherit;
  overflow: hidden;
  background: #2a4ae1;
  color: #fff;
}
.reel-frame::before {
  position: absolute;
  z-index: -1;
  width: 116%;
  height: 65%;
  right: -30%;
  bottom: 9%;
  border: 1px solid #ffffff6b;
  background: repeating-linear-gradient(0deg, #ffffff21 0 1px, transparent 1px 13px);
  content: "";
  transform: rotate(-21deg);
}
.reel-frame p { max-width: 12ch; font-size: clamp(1.14rem, 2.2vw, 2.05rem); line-height: 1.06; letter-spacing: -.05em; text-wrap: balance; }
.reel-frame:lang(th) p { letter-spacing: 0; line-height: 1.23; }
.frame-label { font: 700 .68rem/1.3 var(--mono); text-transform: uppercase; }
.frame-detail { font-size: clamp(.72rem, 1.05vw, .83rem); line-height: 1.35; }
.frame-1 { background: #3b4c73; }
.frame-2 { background: #d6e6ff; color: #19284c; }
.frame-3 { background: #ff9d61; color: #262238; }
.frame-2::before, .frame-3::before {
  border-color: #2636574d;
  background: repeating-linear-gradient(0deg, #26365728 0 1px, transparent 1px 13px);
}
.beats button {
  display: flex;
  align-items: baseline;
  gap: 5px 9px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 44px;
  padding: 7px 7px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-size: .82rem;
}
.beats button[aria-current="step"], .beats button:hover {
  border-color: #6077ae;
  background: #2a3b62;
}
.beats button[aria-current="step"] time { color: #ffac78; }
.beats button:focus-visible, .course a:focus-visible { outline-color: var(--orange); }
.demo-link {
  display: inline-block;
  margin-top: 12px;
  font-size: .88rem;
  color: #d9e4ff;
}
.guide-featured { border-top: 3px solid var(--blue); }

/* Course signup and lesson steps */
.course-actions { display: flex; gap: 12px 18px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.course-details { margin-top: 26px; border-top: 0; }
.course-details h2, .waitlist h2 { font-size: clamp(1.8rem, 3.8vw, 2.65rem); }
.course-details details { margin-top: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.course-details details p { max-width: 68ch; margin-top: 9px; }
.course-details summary { width: fit-content; cursor: pointer; font-weight: 750; }
.waitlist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  padding: clamp(20px, 4vw, 40px);
  align-items: center;
  gap: 16px 24px;
  border: 1px solid #c8d5ff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--pale-blue);
}
.waitlist h2 + p { margin-top: 9px; color: var(--muted); }
.waitlist-form label { display: block; font-size: .88rem; font-weight: 700; }
.waitlist-fields { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.waitlist-fields input {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #8999b5;
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
}
.waitlist-fields button:disabled { opacity: .7; cursor: wait; }
.form-status:not(:empty) { margin-top: 10px; }
.lesson-overview p + p { margin-top: 7px; }
.lesson-overview .quiet { display: inline-block; margin-top: 10px; }
.guide-next { padding: 22px; border-radius: 8px; background: var(--pale-blue); }
.guide-next .button, .guide-next .quiet { margin: 10px 10px 0 0; }

@media (prefers-reduced-motion: no-preference) {
  .reel-frame:not([hidden]) { animation: edit-cut 240ms ease-out both; }
  @keyframes edit-cut {
    from { opacity: .65; transform: scale(.975); }
    to { opacity: 1; transform: scale(1); }
  }
}
@media (max-width: 690px) {
  .waitlist { grid-template-columns: minmax(0, 1fr); }
}
