:root {
  --ink: #17211d;
  --muted: #68736e;
  --surface: #ffffff;
  --soft: #f4f2ec;
  --line: #dedbd2;
  --forest: #1f6f5b;
  --forest-dark: #155142;
  --amber: #c9822b;
  --sky: #dceff1;
  --rose: #f4dddd;
  --shadow: 0 20px 60px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  min-height: 92vh;
  background:
    linear-gradient(115deg, rgba(244, 242, 236, 0.92) 0%, rgba(244, 242, 236, 0.76) 48%, rgba(220, 239, 241, 0.82) 100%),
    radial-gradient(circle at 88% 20%, rgba(201, 130, 43, 0.24), transparent 28%),
    linear-gradient(135deg, #edf5ef 0%, #f4f2ec 45%, #dceff1 100%);
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.spotlight-label {
  color: var(--forest-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-link {
  min-height: 42px;
  padding: 11px 16px;
  border: 1px solid rgba(23, 33, 29, 0.16);
  border-radius: 8px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.55);
}

.hero {
  width: min(1120px, calc(100% - 32px));
  margin: auto;
  padding: 48px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: 56px;
}

.hero-copy h1 {
  max-width: 820px;
  margin: 12px 0 18px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-text {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

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

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 8px;
  padding: 13px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  background: var(--forest);
  color: #fff;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(23, 33, 29, 0.16);
  color: var(--ink);
}

.spotlight {
  min-height: 390px;
  padding: 28px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  display: grid;
  align-content: center;
  justify-items: start;
}

.spotlight-avatar,
.dialog-avatar,
.card-avatar,
.card-photo {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--forest), var(--amber));
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.spotlight-avatar img,
.dialog-avatar img,
.card-avatar img,
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.spotlight-avatar {
  width: min(210px, 78%);
  aspect-ratio: 4 / 5;
  height: auto;
  border-radius: 8px;
  margin: 18px 0 22px;
  font-size: 2.2rem;
  box-shadow: 0 18px 36px rgba(23, 33, 29, 0.18);
}

.spotlight h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.18;
}

.spotlight p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.directory {
  width: min(1120px, calc(100% - 32px));
  margin: 56px auto 90px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 370px);
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}

.section-heading p:last-child {
  color: var(--muted);
  line-height: 1.65;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px) minmax(170px, 220px);
  gap: 12px;
  margin-bottom: 18px;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-field input,
.select-field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

.search-field input:focus,
.select-field select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(31, 111, 91, 0.14);
}

.active-filter {
  margin-bottom: 18px;
  color: var(--forest-dark);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.teacher-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0;
  display: grid;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.teacher-card:hover,
.teacher-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(31, 111, 91, 0.5);
  box-shadow: 0 16px 36px rgba(23, 33, 29, 0.12);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, rgba(31, 111, 91, 0.12), rgba(201, 130, 43, 0.14));
}

.card-photo {
  width: 100%;
  height: 100%;
  border-radius: 0;
  font-size: 2rem;
}

.card-body {
  min-height: 164px;
  padding: 16px;
  display: grid;
  gap: 11px;
  align-content: start;
}

.card-number {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--forest-dark);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.12);
}

.teacher-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.nip {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.subject-line {
  margin: 0;
  padding-left: 10px;
  border-left: 3px solid var(--amber);
  color: var(--forest-dark);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.role-pill {
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--sky);
  color: var(--forest-dark);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.role-pill:nth-child(2n) {
  background: var(--rose);
  color: #6d3636;
}

.empty-state {
  margin-top: 28px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.profile-dialog {
  width: min(720px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.profile-dialog::backdrop {
  background: rgba(23, 33, 29, 0.56);
}

.dialog-shell {
  position: relative;
  background: var(--surface);
  border-radius: 8px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.dialog-avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  border-radius: 8px;
  font-size: 2.1rem;
  box-shadow: 0 18px 42px rgba(23, 33, 29, 0.16);
}

.dialog-content {
  width: 100%;
  text-align: left;
}

.dialog-content h2 {
  margin: 8px 0 22px;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  line-height: 1.08;
}

dl {
  margin: 0;
  display: grid;
  gap: 14px;
  text-align: left;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .site-header {
    min-height: auto;
  }

  .hero,
  .section-heading,
  .toolbar,
  .dialog-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    padding-top: 28px;
  }

  .spotlight {
    min-height: 300px;
  }

  .directory {
    margin-top: 46px;
  }

  .dialog-avatar {
    width: min(220px, 70vw);
    height: auto;
    justify-self: center;
  }

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

@media (max-width: 520px) {
  .topbar {
    width: min(1120px, calc(100% - 24px));
    padding: 14px 0;
    align-items: flex-start;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand strong {
    max-width: 170px;
  }

  .nav-link {
    padding-inline: 12px;
  }

  .hero-copy h1 {
    font-size: 2rem;
    line-height: 1.02;
    margin-bottom: 12px;
  }

  .hero {
    width: min(1120px, calc(100% - 24px));
    gap: 18px;
    padding: 16px 0 24px;
  }

  .hero-text {
    font-size: 0.96rem;
    line-height: 1.55;
    margin: 0;
  }

  .hero-actions {
    margin-top: 18px;
    display: grid;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
    min-height: 44px;
    padding: 11px 16px;
  }

  .spotlight {
    min-height: 0;
    padding: 18px;
  }

  .spotlight-avatar {
    width: 116px;
    aspect-ratio: 4 / 5;
    height: auto;
    margin: 10px 0 14px;
    font-size: 1.6rem;
  }

  .spotlight h2 {
    font-size: 1.18rem;
  }

  .spotlight p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.45;
  }

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