/* EsaulSchool — static rebuild */
@font-face {
  font-family: "Golos Text";
  src: url("fonts/GolosText-var.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #111111;
  --muted: #605e5e;
  --accent: #116dff;
  --panel: rgba(238, 244, 248, 0.86);
  --nav-bg: rgba(242, 246, 249, 0.78);
  --nav-line: rgba(255, 255, 255, 0.9);
  --maxw: 980px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Golos Text", "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef4f7 0%, #dfe9ee 100%);
  line-height: 1.45;
}

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
}

.headline {
  margin: 0;
  font-size: clamp(28px, 5.4vw, 56px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  max-width: 64%;
}

.headline span { display: block; }

.brand-logo {
  width: min(34vw, 360px);
  min-width: 130px;
  flex: 0 1 auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.08));
}

/* ---------- nav ---------- */
.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-line);
  border-bottom: 1px solid var(--nav-line);
  backdrop-filter: blur(4px);
}

.site-nav a {
  flex: 1 1 0;
  text-align: center;
  padding: 20px 6px;
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
  border-right: 1px solid var(--nav-line);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.site-nav a:last-child { border-right: 0; }
.site-nav a:hover { background: rgba(255, 255, 255, 0.55); }
.site-nav a.active { background: #3b3b3b; color: #fff; }

.nav-toggle {
  display: none;
  width: 100%;
  padding: 16px;
  border: 0;
  border-top: 1px solid var(--nav-line);
  border-bottom: 1px solid var(--nav-line);
  background: var(--nav-bg);
  font: 600 16px/1 "Golos Text", sans-serif;
  color: var(--ink);
  cursor: pointer;
}

/* ---------- content ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--panel);
  backdrop-filter: blur(3px);
  padding: clamp(24px, 4vw, 46px);
  min-height: 55vh;
}

.page > :first-child { margin-top: 0; }
.page > :last-child { margin-bottom: 0; }

h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 20px; }
h2 { font-size: clamp(21px, 2.6vw, 28px); margin: 34px 0 12px; }
h3 { font-size: clamp(18px, 2.2vw, 22px); margin: 26px 0 8px; }

p { margin: 0 0 14px; font-size: 17px; }
.lead { font-size: clamp(18px, 2.2vw, 21px); }
.muted { color: var(--muted); }
.small { font-size: 15px; }

a.inline { color: var(--accent); }

/* ---------- home ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: start;
}
.home-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

.facts { list-style: none; margin: 18px 0 0; padding: 0; }
.facts li { padding: 7px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.facts li:last-child { border-bottom: 0; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-block;
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 2px;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(0,0,0,.35); }
.btn:hover { filter: brightness(1.06); }

/* ---------- cards / galleries ---------- */
.grid-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.grid-photos figure { margin: 0; }
.grid-photos img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #cdd8de;
}

.people {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.person { margin: 0; }
.person img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #cdd8de;
}
.person figcaption { font-size: 15px; margin-top: 7px; }

.name-list {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.name-list a {
  display: block;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.62);
  border-left: 3px solid var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.name-list a:hover { background: #fff; }

.name-list--plain li {
  display: block;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.62);
  border-left: 3px solid var(--accent);
  font-weight: 600;
}

.sheet-wrap {
  margin: 22px 0 14px;
  max-width: 760px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}
.sheet-wrap iframe {
  display: block;
  width: 100%;
  height: 1700px;
  border: 0;
}

.skill-person { margin: 0 0 30px; padding-bottom: 24px; border-bottom: 1px solid rgba(0,0,0,.1); }
.skill-person:last-child { border-bottom: 0; padding-bottom: 0; }
.skill-person h2 { margin-top: 0; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery a { display: block; overflow: hidden; background: #cdd8de; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease; }
.gallery a:hover img { transform: scale(1.03); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 18px 0 8px; }
table.skills {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 15px;
  background: rgba(255,255,255,.6);
}
table.skills th, table.skills td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(0,0,0,.09);
  text-align: center;
}
table.skills th:first-child, table.skills td:first-child { text-align: left; }
table.skills thead th { background: rgba(0,0,0,.05); font-weight: 600; font-size: 13px; line-height: 1.25; }
table.skills tbody tr:nth-child(even) { background: rgba(255,255,255,.35); }
td.lvl { font-variant-numeric: tabular-nums; }
.lvl-0 { color: #9aa3a8; }
.lvl-hi { color: var(--accent); font-weight: 600; }

.skills-cards { display: none; }
.skill-card {
  background: rgba(255,255,255,.6);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.skill-card h4 { margin: 0 0 8px; font-size: 17px; }
.skill-card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-size: 15px; }
.skill-card dt { color: var(--muted); }
.skill-card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- teams ---------- */
.team { margin: 0 0 34px; padding-bottom: 26px; border-bottom: 1px solid rgba(0,0,0,.1); }
.team:last-child { border-bottom: 0; padding-bottom: 0; }
.team h2 { margin-top: 0; }
.team p { max-width: 70ch; }

/* ---------- calendar ---------- */
.calendar-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 420px;
  border: 0;
  background: #fff;
}
.calendar-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.events { list-style: none; margin: 10px 0 0; padding: 0; }
.events li { padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.events .date { font-weight: 600; }
.events .where { color: var(--muted); font-size: 14px; }

/* ---------- contacts ---------- */
.contact-list { list-style: none; padding: 0; margin: 0 0 20px; }
.contact-list li { font-size: clamp(18px, 2.4vw, 22px); padding: 8px 0; }
.contact-list a { color: var(--ink); text-decoration: none; border-bottom: 2px solid rgba(17,109,255,.35); }
.contact-list a:hover { border-bottom-color: var(--accent); }

.socials { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 24px; }
.socials a { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; }
.socials img { width: 34px; height: 34px; object-fit: contain; }

.map { margin-top: 28px; }
.map iframe { width: 100%; height: 380px; border: 0; display: block; }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px 30px;
  font-size: 13px;
  color: #2c2c2c;
  text-align: center;
  background: rgba(255,255,255,.35);
}
.site-footer a { color: inherit; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 18, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; }
.lightbox button {
  position: absolute;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  width: 46px;
  height: 46px;
  font-size: 22px;
  cursor: pointer;
}
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  body { background-attachment: scroll; }
  .site-header { padding: 20px 14px 12px; align-items: center; gap: 8px; }
  .headline { font-size: clamp(18px, 6vw, 36px); max-width: 66%; min-width: 0; }
  .brand-logo { width: min(28vw, 240px); min-width: 88px; }
  .nav-toggle { display: block; }
  .site-nav { display: none; flex-direction: column; }
  .site-nav.open { display: flex; }
  .site-nav a { border-right: 0; border-bottom: 1px solid var(--nav-line); padding: 15px 12px; font-size: 16px; }
  .site-nav a:last-child { border-bottom: 0; }
  .home-grid { grid-template-columns: 1fr; gap: 20px; }
  .grid-photos { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 22px 18px 30px; }
  .table-wrap { display: none; }
  .skills-cards { display: block; }
  .calendar-frame { aspect-ratio: 3 / 4; min-height: 460px; }
  .map iframe { height: 300px; }
  .sheet-wrap { max-width: none; }
}

@media (max-width: 640px) {
  .people { grid-template-columns: repeat(3, 1fr); }
  .name-list { grid-template-columns: 1fr; }
  .sheet-wrap iframe { height: 2200px; }
}

@media (max-width: 420px) {
  .people { grid-template-columns: repeat(2, 1fr); }
  .grid-photos { gap: 6px; }
}

/* ---------- calendar app ---------- */
.calendar-app {
  margin: 22px 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 34px rgba(20, 40, 60, 0.08);
  overflow: hidden;
}
.cal-loading { padding: 42px 20px; text-align: center; color: var(--muted); }

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: rgba(224, 232, 238, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
}
.cal-title {
  margin-right: auto;
  font-size: clamp(18px, 2.3vw, 22px);
  font-weight: 700;
  line-height: 1.2;
}
.cal-nav { display: flex; gap: 5px; }
.cal-nav[hidden] { display: none; }
.cal-btn {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 3px;
  padding: 7px 10px;
  font: 600 14px/1 "Golos Text", sans-serif;
  cursor: pointer;
}
.cal-btn:hover { background: #fff; }
.cal-btn:disabled { opacity: 0.4; cursor: default; }
.cal-views {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.6);
}
.cal-views button {
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 3px;
  padding: 7px 10px;
  font: 600 13px/1 "Golos Text", sans-serif;
  cursor: pointer;
}
.cal-views button:hover { background: rgba(255, 255, 255, 0.85); }
.cal-views button.active { background: #3b3b3b; color: #fff; }

/* month */
.cal-month { padding: 10px 12px 14px; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-day {
  min-height: 112px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cal-day.out { background: rgba(255, 255, 255, 0.22); color: #9aa3a8; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-daynum { font-size: 13px; font-weight: 600; line-height: 1; }
.cal-day.today .cal-daynum { color: var(--accent); }
.cal-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-event {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 3px 5px;
  background: var(--c, #3f7fd0);
  color: #fff;
  font: 500 11px/1.2 "Golos Text", sans-serif;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event:hover { filter: brightness(1.08); }
.cal-event .cal-time { margin-right: 4px; opacity: 0.86; font-variant-numeric: tabular-nums; }
.cal-more {
  border: 0;
  background: none;
  padding: 1px 2px;
  color: var(--muted);
  font: 500 11px/1.2 "Golos Text", sans-serif;
  text-align: left;
  cursor: pointer;
}
.cal-more:hover { color: var(--ink); }

/* agenda */
.cal-agenda { padding: 4px 18px 18px; }
.cal-agenda-day { padding: 14px 0 4px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.cal-agenda-day:last-child { border-bottom: 0; }
.cal-agenda-date { margin-bottom: 6px; font-size: 16px; font-weight: 700; }
.cal-agenda-date .cal-weekday { color: var(--muted); font-weight: 500; }
.cal-agenda-event {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 4px 0;
  padding: 8px 10px 8px 12px;
  border: 0;
  border-left: 3px solid var(--c, #3f7fd0);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.cal-agenda-event:hover { background: rgba(255, 255, 255, 0.62); }
.cal-agenda-time { flex: 0 0 92px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-agenda-title { font-size: 15px; line-height: 1.3; }
.cal-agenda-where { margin-top: 2px; color: var(--muted); font-size: 13px; }
.cal-empty { padding: 30px 16px; text-align: center; color: var(--muted); }

/* week / day */
.cal-week { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.cal-week-head {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(96px, 1fr));
  background: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.cal-week-head > div {
  padding: 8px 6px;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
}
.cal-week-head > div:first-child { border-left: 0; }
.cal-week-head .today { color: var(--accent); font-weight: 700; }
.cal-week-body {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(96px, 1fr));
  max-height: 68vh;
  overflow: auto;
}
.cal-week-times { display: flex; flex-direction: column; }
.cal-week-times span {
  height: 44px;
  padding-right: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  transform: translateY(-6px);
}
.cal-week-col { position: relative; border-left: 1px solid rgba(0, 0, 0, 0.06); }
.cal-hour { height: 44px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.cal-week-event {
  position: absolute;
  left: 2px;
  right: 2px;
  z-index: 1;
  overflow: hidden;
  padding: 2px 5px;
  border: 0;
  border-radius: 3px;
  background: var(--c, #3f7fd0);
  color: #fff;
  font: 500 11px/1.2 "Golos Text", sans-serif;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-week-event:hover { filter: brightness(1.08); }
.cal-week-event .cal-time { display: inline; margin-right: 4px; opacity: 0.86; font-variant-numeric: tabular-nums; }
.cal-week.single .cal-week-head,
.cal-week.single .cal-week-body { grid-template-columns: 54px minmax(0, 1fr); }

/* modal */
.cal-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 14, 18, 0.58);
}
.cal-modal.open { display: flex; }
.cal-modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 22px 24px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}
.cal-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cal-modal h3 { margin: 0 32px 10px 0; }
.cal-modal-meta { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.cal-modal-desc { white-space: pre-line; font-size: 15px; }

/* contacts */
.contact-chats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.chat-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-weight: 600;
}
.chat-link:hover { background: #fff; border-color: var(--accent); }
.chat-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #6a5cff;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chat-telegram .chat-icon { background: #2aabee; }

@media (max-width: 900px) {
  .cal-toolbar { padding: 12px; gap: 8px; }
  .cal-title { flex: 1 1 100%; margin-right: 0; }
  .cal-nav { order: 2; }
  .cal-views { order: 3; width: 100%; }
  .cal-views button { flex: 1; padding: 8px 6px; font-size: 12px; }
  .cal-month { padding: 8px 6px 10px; }
  .cal-day { min-height: 82px; padding: 4px; gap: 3px; }
  .cal-event { padding: 2px 4px; font-size: 10px; }
  .cal-event .cal-time { display: none; }
  .cal-agenda { padding: 2px 10px 14px; }
  .cal-agenda-event { gap: 8px; }
  .cal-agenda-time { flex-basis: 76px; font-size: 13px; }
  .cal-week-head, .cal-week-body { grid-template-columns: 44px repeat(7, minmax(78px, 1fr)); }
  .cal-week.single .cal-week-head,
  .cal-week.single .cal-week-body { grid-template-columns: 44px minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .cal-day { min-height: 66px; }
  .cal-daynum { font-size: 12px; }
  .cal-event { font-size: 9px; }
  .cal-weekdays span { font-size: 10px; }
}
