:root {
  --ink: #17233a;
  --ink-deep: #101829;
  --paper: #f4f0e5;
  --paper-soft: #ebe5d6;
  --coral: #e8694a;
  --button-accent: #991b1b;
  --yellow: #e4c84a;
  --white: #fffdf7;
  --line: rgba(23, 35, 58, 0.16);
  --muted: #5e6470;
  --shadow: 0 18px 50px rgba(16, 24, 41, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Outfit", Aptos, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.site-header {
  width: min(1120px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 700;
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 3px;
}

main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 72px;
  padding: 64px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
blockquote {
  font-family: inherit;
}

h1,
h2,
h3 {
  line-height: 1.05;
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(52px, 7vw, 92px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 560px;
  margin: 28px 0 32px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.nav a:focus-visible,
.brand:focus-visible,
footer a:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}

.button-primary {
  border-color: var(--button-accent);
  background: var(--button-accent);
  color: var(--white);
}

.button-primary:hover {
  background: #7f1717;
  border-color: #7f1717;
}

.button-secondary {
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--yellow);
}

.class-panel {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 14px 14px 0 var(--yellow);
}

.class-panel-number {
  position: absolute;
  top: -28px;
  left: 18px;
  color: rgba(244, 240, 229, 0.12);
  font-size: 230px;
  line-height: 1;
}

.class-panel-letter {
  position: absolute;
  right: 18px;
  bottom: 48px;
  color: var(--coral);
  font-size: 180px;
  line-height: 0.72;
}

.class-panel p {
  position: absolute;
  left: 28px;
  bottom: 20px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.section-heading {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: baseline;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  letter-spacing: -0.04em;
}

.teacher-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.teacher-card img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  object-position: top;
}

.teacher-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.teacher-role {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.teacher-copy h3 {
  margin: 0 0 24px;
  font-size: 42px;
}

.teacher-copy blockquote {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.subject-grid,
.member-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.subject-grid li {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  min-height: 84px;
  padding: 16px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 750;
}

.subject-grid span {
  color: var(--coral);
  font-size: 14px;
}

.chat-panel {
  max-width: 760px;
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.chat-messages {
  display: flex;
  min-height: 260px;
  max-height: 440px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 24px;
}

.chat-message {
  max-width: min(85%, 560px);
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message-assistant {
  align-self: flex-start;
  background: var(--paper-soft);
}

.chat-message-user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--white);
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 24px 12px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.chat-form textarea:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.chat-form .button {
  flex: 0 0 auto;
  cursor: pointer;
}

.chat-form .button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chat-hint {
  margin: 0;
  padding: 0 24px 16px;
  color: var(--muted);
  font-size: 12px;
}

.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;
}

.page-intro {
  padding: 88px 0 48px;
  border-bottom: 1px solid var(--line);
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 82px);
  letter-spacing: -0.05em;
}

.structure-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.structure-card img {
  width: 100%;
  height: auto;
}

.member-list {
  counter-reset: members;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.member-list li {
  min-height: 64px;
  padding: 20px 18px 18px 48px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-weight: 700;
  counter-increment: members;
}

.member-list li::before {
  content: counter(members, decimal-leading-zero);
  position: absolute;
  left: 12px;
  color: var(--coral);
  font-size: 12px;
}

main > .button {
  margin-bottom: 72px;
}

.creator-card {
  min-height: 560px;
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  gap: 64px;
  padding: 72px 0;
}

.creator-card img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 12px solid var(--white);
  box-shadow: 12px 12px 0 var(--yellow);
}

.creator-card h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 76px);
  letter-spacing: -0.05em;
}

.creator-card > div > p:not(.eyebrow) {
  max-width: 560px;
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: 20px;
}

footer {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer p {
  margin: 0;
}

.not-found {
  display: flex;
  flex-direction: column;
}

.not-found main {
  display: grid;
  flex: 1;
  place-items: center;
}

.error-page {
  width: min(100%, 680px);
  padding: 72px 0;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--coral);
  font-size: clamp(100px, 22vw, 180px);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.error-page h1 {
  margin: 20px 0 12px;
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.error-page > p:not(.error-code) {
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
}

.error-page .hero-actions {
  justify-content: center;
}

@media (max-width: 820px) {
  .site-header,
  main,
  footer {
    width: min(100% - 32px, 1120px);
  }

  .site-header {
    height: 76px;
  }

  .nav {
    gap: 14px;
  }

  .brand > span:last-child {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
    padding: 56px 0 64px;
  }

  .hero h1 {
    font-size: clamp(48px, 15vw, 72px);
  }

  .class-panel {
    min-height: 320px;
  }

  .class-panel-number {
    font-size: 190px;
  }

  .class-panel-letter {
    font-size: 150px;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    margin-top: 4px;
  }

  .teacher-card,
  .creator-card {
    grid-template-columns: 1fr;
  }

  .teacher-card img {
    height: 360px;
  }

  .teacher-copy {
    padding: 32px 24px;
  }

  .subject-grid,
  .member-list {
    grid-template-columns: 1fr;
  }

  .chat-form {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form .button {
    width: 100%;
  }

  .creator-card {
    justify-items: start;
    gap: 40px;
  }

  .creator-card img {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 480px) {
  .nav a:first-child {
    display: none;
  }

  .hero {
    padding-top: 40px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .error-page .hero-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .teacher-card img {
    height: 300px;
  }

  footer {
    min-height: 136px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
}

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

  .button {
    transition: none;
  }
}
