/* ==========================================================
   Kiran's Tuition – main stylesheet
   Palette taken from images/cover.png and images/profile.png
   ========================================================== */

:root {
  --berry: #a62d5a;
  --berry-dark: #7e1f43;
  --mustard: #f5cf2f;
  --kraft: #c08a55;
  --kraft-dark: #8a5a2e;
  --cream: #f6eee7;
  --cream-deep: #ede0d6;
  --peach: #ffb4a2;
  --plum: #b3838e;
  --ink: #2e2328;
  --ink-soft: #5c4d54;
  --white: #ffffff;

  --radius: 14px;
  --shadow: 0 6px 20px rgba(46, 35, 40, 0.10);
  --max-width: 1100px;
  --gutter: clamp(16px, 4vw, 32px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* Discourage saving images (see protectImages() in main.js) */
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;     /* no dragging to desktop (Safari/Chrome) */
  -webkit-touch-callout: none; /* no "Save to Photos" on iPhone/iPad long-press */
}

a {
  color: var(--berry);
}

a:hover,
a:focus-visible {
  color: var(--berry-dark);
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.2;
  color: var(--berry-dark);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.4rem); }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--mustard);
  color: var(--ink);
  padding: 8px 14px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- Cover banner ---------- */

.site-header {
  background: var(--kraft);
}

.cover {
  max-width: var(--max-width);
  margin: 0 auto;
}

.cover img {
  width: 100%;
  aspect-ratio: 851 / 315;
  object-fit: cover;
}

/* ---------- Navigation bar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--berry);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.nav-brand {
  display: none;
  color: var(--white);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  color: var(--white);
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 16px 20px;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 4px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--berry-dark);
  color: var(--white);
}

.nav-links a[aria-current="page"] {
  border-bottom-color: var(--mustard);
}

/* ---------- Main content ---------- */

main {
  padding: clamp(28px, 5vw, 56px) 0;
}

.section {
  margin-bottom: clamp(36px, 6vw, 64px);
}

.lead {
  font-size: 1.15em;
  color: var(--ink-soft);
}

/* Hero: text + image side by side, stacks on small screens */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}

.hero img,
.feature-img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  object-fit: cover;
}

.hero img {
  aspect-ratio: 4 / 3;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--berry);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--berry-dark);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--mustard);
  color: var(--ink);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #e6bd16;
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.2em;
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 3vw, 28px);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.card-body {
  padding: 20px 22px 24px;
  flex: 1;
}

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

/* About block with round profile image */
.about {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  background: var(--cream-deep);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 40px);
}

.about img {
  width: 100%;
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 6px solid var(--white);
  box-shadow: var(--shadow);
}

/* Links / quick-links list */
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.link-list a {
  display: block;
  background: var(--white);
  border-left: 6px solid var(--mustard);
  border-radius: 8px;
  padding: 14px 18px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.link-list a:hover,
.link-list a:focus-visible {
  border-left-color: var(--berry);
}

/* Page banner image used on inner pages */
.page-banner {
  width: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: clamp(24px, 4vw, 40px);
}

/* ---------- Pricing ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 3vw, 28px);
  align-items: stretch;
}

.price-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  border-top: 8px solid var(--kraft);
}

.price-card.featured {
  border-top-color: var(--berry);
  transform: scale(1.03);
}

.price-card .tag {
  align-self: center;
  background: var(--mustard);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.price {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--berry);
  margin: 0.2em 0;
}

.price small {
  font-size: 1rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 1em 0 1.5em;
  text-align: left;
  flex: 1;
}

.price-card li {
  padding: 8px 0 8px 28px;
  border-bottom: 1px dashed var(--cream-deep);
  position: relative;
}

.price-card li::before {
  content: "\2713";
  position: absolute;
  left: 4px;
  color: var(--berry);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 420px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--cream-deep);
}

th {
  background: var(--berry);
  color: var(--white);
}

tbody tr:nth-child(even) {
  background: #fbf7f3;
}

/* ---------- Legal pages ---------- */

.legal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 48px);
}

.legal h2 {
  margin-top: 1.6em;
  font-size: clamp(1.2rem, 1.1rem + 0.6vw, 1.5rem);
}

.legal h2:first-of-type {
  margin-top: 0.5em;
}

.legal .updated {
  color: var(--ink-soft);
  font-style: italic;
}

.toc {
  background: var(--cream);
  border-radius: 10px;
  padding: 16px 24px;
  margin: 1em 0 1.5em;
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
}

.notice {
  background: #fff7d6;
  border-left: 6px solid var(--mustard);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1.5em;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #e9dfe3;
  padding: 32px 0;
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

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

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* Back-to-top button */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--mustard);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Fade-in on scroll (enabled by JS) */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ==========================================================
   Responsive breakpoints
   ========================================================== */

/* Tablet */
@media (max-width: 900px) {
  .nav-links a {
    padding: 14px 14px;
  }

  .about {
    grid-template-columns: 160px 1fr;
  }

  .price-card.featured {
    transform: none;
  }
}

/* Phone */
@media (max-width: 680px) {
  .nav-brand,
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--berry);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  }

  .navbar.open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 14px var(--gutter);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 4px solid transparent;
  }

  .nav-links a[aria-current="page"] {
    border-bottom-color: rgba(255, 255, 255, 0.15);
    border-left-color: var(--mustard);
  }

  .navbar.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .navbar.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero,
  .about {
    grid-template-columns: 1fr;
  }

  .hero img {
    order: -1;
  }

  .about {
    text-align: center;
  }

  .about img {
    max-width: 180px;
    margin: 0 auto;
  }

  .page-banner {
    aspect-ratio: 16 / 7;
  }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ---------- Booking (embedded Zoom Scheduler) ---------- */

.scheduler {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

/* "Please wait" overlay shown until the scheduler has loaded */
.scheduler-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 160px;
  gap: 18px;
  background: var(--white);
  color: var(--ink-soft);
  font-weight: 700;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.scheduler-loading p {
  margin: 0;
  padding: 0 var(--gutter);
}

.scheduler-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 5px solid var(--cream-deep);
  border-top-color: var(--berry);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.5s; }
}

.scheduler iframe {
  display: block;
  width: 100%;
  height: 850px;
  border: 0;
}

.scheduler-fallback {
  margin-top: 1em;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

@media (max-width: 680px) {
  .scheduler iframe {
    height: 1000px;
  }
}
