/* === sameerkhairkar.com custom styles === */

/* === Self-hosted fonts (SIL OFL 1.1) — no third-party requests ===
   Inter for text, JetBrains Mono for code. Files in docs/assets/fonts/. */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --md-text-font: "Inter";
  --md-code-font: "JetBrains Mono";
}
/* Landing in the manner of the Material for MkDocs homepage: a flat hero
   band with content left + floating illustration right, a wave divider
   (same CC0 wave), then feature cards. Illustrations are clay-diorama
   renders on transparency (docs/assets/images/dioramas/). */

/* === Full-bleed landing hero (mdx-container) === */
/* Fills the first viewport (minus header chrome) so the landing reads as one
   immersive surface; header/tabs are tinted to match in home.html. */
.mdx-container {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 2.4rem);
  padding-top: 1.5rem;
  background: linear-gradient(to bottom, #F6F0E8 0%, #F3EADD 70%, #EFE4D2 100%);
  color: #17171C;
  overflow: hidden;
}

/* Tabs are visible from 76.25em, adding another 2.4rem of chrome */
@media screen and (min-width: 76.25em) {
  .mdx-container {
    min-height: calc(100vh - 4.8rem);
  }
}

.mdx-container > .md-grid {
  width: 100%;
}

/* Scroll cue: chevron bobbing above the wave */
.mdx-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  width: 0.9rem;
  height: 0.9rem;
  border-right: 2px solid #E91E63;
  border-bottom: 2px solid #E91E63;
  transform: translateX(-50%) rotate(45deg);
  z-index: 3;
  animation: mdx-bob 2.2s ease-in-out infinite;
}

@keyframes mdx-bob {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: -0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mdx-hero__scroll {
    animation: none;
  }
}

[data-md-color-scheme="slate"] .mdx-container {
  background: linear-gradient(to bottom, #1e2129 0%, #191c23 100%);
  color: #f2ede4;
}

/* Wave at the bottom — same as the Material site (CC0) */
.mdx-container::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 5rem;
  z-index: 2;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path d='M0,48 C240,88 480,8 720,48 C960,88 1200,8 1440,48 L1440,120 L0,120 Z' style='fill: white' /></svg>") no-repeat bottom / 100% 5rem;
}

[data-md-color-scheme="slate"] .mdx-container::after {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path d='M0,48 C240,88 480,8 720,48 C960,88 1200,8 1440,48 L1440,120 L0,120 Z' style='fill: %231e2129' /></svg>") no-repeat bottom / 100% 5rem;
}

/* === Hero layout (mdx-hero) — content left, illustration right === */
.mdx-hero {
  position: relative;
  z-index: 1;
  margin: 0 1rem;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1rem;
  padding-bottom: 7rem;
}

.mdx-hero__content {
  padding-top: 1.5rem;
  max-width: 32rem;
}

.mdx-hero__image {
  position: relative;
  flex: 1 1 auto;
  max-width: 38rem;
  width: 100%;
}

/* Soft warm glow behind the diorama so it sits "in" the scene */
.mdx-hero__image::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(233, 30, 99, 0.10), transparent 72%);
  pointer-events: none;
}

.mdx-hero__image img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 44px rgba(23, 23, 28, 0.22));
  will-change: transform;
}

.mdx-hero__eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: #E91E63;
  margin-bottom: 1.25rem;
}

.mdx-hero h1 {
  margin: 0 0 1.25rem 0;
  font-weight: 700;
  color: currentcolor;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  border: none;
}

.mdx-hero p {
  color: currentcolor;
  opacity: 0.82;
  line-height: 1.55;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* === Hero buttons === */
.mdx-hero .md-button {
  margin: 1.25rem 0.75rem 0 0;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  color: currentcolor;
  border: 1px solid currentcolor;
  background: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mdx-hero .md-button:hover,
.mdx-hero .md-button:focus {
  background: #17171C;
  color: #F6F0E8;
  border-color: #17171C;
}

.mdx-hero .md-button--primary {
  background: #E91E63;
  color: #fff;
  border-color: #E91E63;
}

.mdx-hero .md-button--primary:hover,
.mdx-hero .md-button--primary:focus {
  background: #c2185b;
  color: #fff;
  border-color: #c2185b;
}

/* === Tablet+ layout: side by side, image right === */
@media screen and (min-width: 60em) {
  .mdx-hero {
    flex-direction: row;
    justify-content: space-between;
    gap: 2.5rem;
    padding-bottom: 8rem;
  }

  .mdx-hero__content {
    order: 0;
    flex: 0 1 32rem;
  }

  .mdx-hero__image {
    order: 1;
    flex: 0 1 38rem;
  }
}

/* === The world grid (below the hero) === */
.mdx-world {
  padding: 0 1rem 1rem;
}

.mdx-world h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1rem 0 1.25rem;
}

.mdx-world__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}

/* Desktop: 3 cards on top, 2 centered below (V shape) */
@media screen and (min-width: 60em) {
  .mdx-world__grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .mdx-world__card { grid-column: span 2; }
  .mdx-world__card:nth-child(4) { grid-column: 2 / span 2; }
  .mdx-world__card:nth-child(5) { grid-column: 4 / span 2; }
}

.mdx-world__card {
  display: block;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mdx-world__card:hover,
.mdx-world__card:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  border-color: #E91E63;
}

[data-md-color-scheme="slate"] .mdx-world__card:hover,
[data-md-color-scheme="slate"] .mdx-world__card:focus {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.mdx-world__card img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.6rem;
}

.mdx-world__card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.mdx-world__card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

/* === Paper texture on the content area (light scheme) ===
   Real scanned paper, mirror-tiled so it repeats seamlessly. */
.md-main {
  background-image: url("../assets/images/paper-tile.jpg");
  background-repeat: repeat;
  background-size: 512px 512px;
}

[data-md-color-scheme="slate"] .md-main {
  background-image: none;   /* keep dark mode clean */
}

/* === Below the hero: standard article styling === */
.md-content__inner {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

/* === Card hover effect === */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border-radius: 6px;
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--md-accent-fg-color);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li:hover,
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ol > li:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* === Latest post preview block === */
.md-typeset .post-preview {
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.5rem 0;
  border-left: 3px solid var(--md-accent-fg-color);
  background: var(--md-default-fg-color--lightest);
  border-radius: 0 6px 6px 0;
}

.md-typeset .post-preview .post-meta {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.5rem;
}

.md-typeset .post-preview p {
  margin: 0.5rem 0 0.75rem 0;
  color: var(--md-default-fg-color--light);
}

.md-typeset .post-preview a.more {
  font-weight: 600;
  color: var(--md-accent-fg-color);
}

/* === Palette toggle fix (landing page) ===
   home.html un-fixes .md-header, which makes the hidden palette radio inputs
   resolve to the bottom of the document; clicking the toggle then scroll-jumps
   to the focused input. Pin the hidden inputs to the viewport instead. */
input.md-option {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
}
