/* ==========================================================================
   Meet Adi — one-screen homepage
   Single stylesheet for the whole page (loader + layout), per issue #32 §8.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Agustina";
  src: local("Agustina"), url("../media/agustina.21f233e1.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Theme tokens
   Ported from adisakshya/weblog src/styles/journal.css so the homepage
   matches whatever theme a reader already chose on the Web Journal
   (shared localStorage key "journal-prefs"). Default / fallback is
   "original" (Daylight), matching the weblog's own default.
   -------------------------------------------------------------------------- */
:root,
[data-theme="original"] {
  --bg: #ffffff;
  --fg: #1b1b22;
  --muted: #555a66;
  --panel: #f4f4f8;
  --border: #dcdce6;
  --accent: #4338ca;
  --accent-fg: #ffffff;
  color-scheme: light;
}
[data-theme="paper"] {
  --bg: #fbf7ef;
  --fg: #2a2621;
  --muted: #5f574b;
  --panel: #f2ebdd;
  --border: #e0d6c3;
  --accent: #4338ca;
  --accent-fg: #ffffff;
  color-scheme: light;
}
[data-theme="sepia"] {
  --bg: #f6e3b8;
  --fg: #3a2a12;
  --muted: #5c4520;
  --panel: #eed29a;
  --border: #d8b878;
  --accent: #8a4b00;
  --accent-fg: #ffffff;
  color-scheme: light;
}
[data-theme="solarized-light"] {
  --bg: #fdf6e3;
  --fg: #2f3d44;
  --muted: #53646b;
  --panel: #eee8d5;
  --border: #ddd6c1;
  --accent: #3b3fb0;
  --accent-fg: #ffffff;
  color-scheme: light;
}
[data-theme="dark-modern"] {
  --bg: #1f1f1f;
  --fg: #eeeeee;
  --muted: #bcbcbc;
  --panel: #2b2b2b;
  --border: #3c3c3c;
  --accent: #a5b4fc;
  --accent-fg: #14143a;
  color-scheme: dark;
}
[data-theme="solarized-dark"] {
  --bg: #002b36;
  --fg: #d1dfe1;
  --muted: #aac0c4;
  --panel: #073642;
  --border: #164854;
  --accent: #a5b4fc;
  --accent-fg: #0b1640;
  color-scheme: dark;
}
[data-theme="space"] {
  --bg: #101222;
  --fg: #edf0ff;
  --muted: #b8bfdc;
  --panel: #1b2038;
  --border: #2c3354;
  --accent: #c5b5ff;
  --accent-fg: #17123a;
  color-scheme: dark;
}
[data-theme="spiderman"] {
  --bg: #111b32;
  --fg: #f2f4ff;
  --muted: #bac8e0;
  --panel: #1b2b48;
  --border: #516382;
  --accent: #ff7d85;
  --accent-fg: #26101b;
  color-scheme: dark;
}
[data-theme="batman"] {
  --bg: #191b20;
  --fg: #f3f1e9;
  --muted: #c4c2b8;
  --panel: #292c33;
  --border: #62636a;
  --accent: #efc34f;
  --accent-fg: #241e0e;
  color-scheme: dark;
}
[data-theme="superman"] {
  --bg: #102646;
  --fg: #f0f5ff;
  --muted: #bfcee4;
  --panel: #1b365a;
  --border: #58759b;
  --accent: #ffd378;
  --accent-fg: #302008;
  color-scheme: dark;
}
[data-theme="ironman"] {
  --bg: #30151e;
  --fg: #fff0ec;
  --muted: #dbc0c5;
  --panel: #45232d;
  --border: #85626a;
  --accent: #f6cf79;
  --accent-fg: #302007;
  color-scheme: dark;
}
/* Ring (focus/inset outline): not a weblog token, derived from --fg so it
   reproduces the 4 values given in issue #32 exactly: 18% opacity on the
   4 light themes, 32% on the 7 dark ones. */
:root,
[data-theme="original"],
[data-theme="paper"],
[data-theme="sepia"],
[data-theme="solarized-light"] {
  --ring: color-mix(in srgb, var(--fg) 18%, transparent);
}
[data-theme="dark-modern"],
[data-theme="solarized-dark"],
[data-theme="space"],
[data-theme="spiderman"],
[data-theme="batman"],
[data-theme="superman"],
[data-theme="ironman"] {
  --ring: color-mix(in srgb, var(--fg) 32%, transparent);
}
/* Vermilion brand point — the one accent colour that never changes with theme. */
:root {
  --point: #e2492c;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}
.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;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Loader — pure CSS "jetpack person", adapted from Mr. Alien's CodePen
   "speeder" (https://codepen.io/mr_alien/pen/FDLjg). Re-themed with CSS
   variables (was hard-coded #fff / #000) and pinned to the viewport.
   -------------------------------------------------------------------------- */
#loader-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.3s ease;
}
#loader-wrapper[hidden] {
  display: none;
}
.loader-body {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -50px;
  animation: speeder 0.4s linear infinite;
  z-index: 1000;
}
.loader-body > span {
  height: 5px;
  width: 35px;
  background: var(--fg);
  position: absolute;
  top: -19px;
  left: 60px;
  border-radius: 2px 10px 1px 0;
}
.loader-base span {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-right: 100px solid var(--fg);
  border-bottom: 6px solid transparent;
}
.loader-base span::before {
  content: "";
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--fg);
  position: absolute;
  right: -110px;
  top: -16px;
}
.loader-base span::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 0 solid transparent;
  border-right: 55px solid var(--fg);
  border-bottom: 16px solid transparent;
  top: -16px;
  right: -98px;
}
.loader-face {
  position: absolute;
  height: 12px;
  width: 20px;
  background: var(--fg);
  border-radius: 20px 20px 0 0;
  transform: rotate(-40deg);
  right: -125px;
  top: -15px;
}
.loader-face::after {
  content: "";
  height: 12px;
  width: 12px;
  background: var(--bg);
  right: 4px;
  top: 7px;
  position: absolute;
  transform: rotate(40deg);
  transform-origin: 50% 50%;
  border-radius: 0 0 0 2px;
}
.loader-body > span > span:nth-child(1),
.loader-body > span > span:nth-child(2),
.loader-body > span > span:nth-child(3),
.loader-body > span > span:nth-child(4) {
  width: 30px;
  height: 1px;
  background: var(--fg);
  position: absolute;
  animation: fazer1 0.2s linear infinite;
}
.loader-body > span > span:nth-child(2) {
  top: 3px;
  animation: fazer2 0.4s linear infinite;
}
.loader-body > span > span:nth-child(3) {
  top: 1px;
  animation: fazer3 0.4s linear infinite;
  animation-delay: -1s;
}
.loader-body > span > span:nth-child(4) {
  top: 4px;
  animation: fazer4 1s linear infinite;
  animation-delay: -1s;
}
@keyframes fazer1 {
  0% { left: 0; }
  100% { left: -80px; opacity: 0; }
}
@keyframes fazer2 {
  0% { left: 0; }
  100% { left: -100px; opacity: 0; }
}
@keyframes fazer3 {
  0% { left: 0; }
  100% { left: -50px; opacity: 0; }
}
@keyframes fazer4 {
  0% { left: 0; }
  100% { left: -150px; opacity: 0; }
}
@keyframes speeder {
  0% { transform: translate(2px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -3px) rotate(-1deg); }
  20% { transform: translate(-2px, 0px) rotate(1deg); }
  30% { transform: translate(1px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 3px) rotate(-1deg); }
  60% { transform: translate(-1px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-2px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 1px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.loader-longfazers {
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow: hidden;
}
.loader-longfazers span {
  position: absolute;
  height: 2px;
  width: 20%;
  background: var(--fg);
  opacity: 0.6;
}
.loader-longfazers span:nth-child(1) {
  top: 20%;
  animation: lf 0.6s linear infinite;
  animation-delay: -5s;
}
.loader-longfazers span:nth-child(2) {
  top: 40%;
  animation: lf2 0.8s linear infinite;
  animation-delay: -1s;
}
.loader-longfazers span:nth-child(3) {
  top: 60%;
  animation: lf3 0.6s linear infinite;
}
.loader-longfazers span:nth-child(4) {
  top: 80%;
  animation: lf4 0.5s linear infinite;
  animation-delay: -3s;
}
@keyframes lf {
  0% { left: 200%; }
  100% { left: -200%; opacity: 0; }
}
@keyframes lf2 {
  0% { left: 200%; }
  100% { left: -200%; opacity: 0; }
}
@keyframes lf3 {
  0% { left: 200%; }
  100% { left: -100%; opacity: 0; }
}
@keyframes lf4 {
  0% { left: 200%; }
  100% { left: -100%; opacity: 0; }
}

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */
.site-header {
  container-type: inline-size;
  flex: 0 0 auto;
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: 16px 24px;
}
.brand {
  display: inline-block;
  font-family: "Agustina", "Herr Von Muellerhoff", cursive;
  font-size: clamp(30px, 3.4cqi, 40px);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

main {
  container-type: inline-size;
  /* flex-basis 0 + grow fills remaining space on screens where the content
     fits (desktop, §3's "one screen"); flex's default automatic minimum
     size (content-based, since min-height isn't overridden to 0) stops the
     browser compressing it smaller than its content on narrow viewports,
     so the page grows and scrolls there instead of the footer overlapping
     the last pill. */
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
}
.intro {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  text-align: center;
}

.hindi-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25em;
  width: fit-content;
  margin: 0 auto 0.3em;
  font-family: "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;
  font-style: italic;
  font-size: clamp(32px, 4.4cqi, 56px);
  line-height: 1.2;
}
.hindi-name .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--point);
  flex-shrink: 0;
}

h1 {
  margin: 0 auto 0.6em;
  max-width: 32ch;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: clamp(30px, 4.4cqi, 56px);
  line-height: 1.12;
  letter-spacing: -0.012em;
}
.tw-stage {
  display: grid;
  width: 100%;
}
.tw-stage > * {
  grid-area: 1 / 1;
}
.tw-sizer {
  visibility: hidden;
  display: grid;
}
.tw-sizer > span {
  grid-area: 1 / 1;
}
.tw-row {
  align-self: start;
}
.tw-cursor {
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  margin-left: 0.08em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: tw-blink 1.06s steps(1) infinite;
}
.tw-cursor[hidden] {
  display: none;
}
@keyframes tw-blink {
  50% { opacity: 0; }
}

.supporting {
  max-width: 40rem;
  font-size: 19px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 auto 1.75em;
}

.pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 46rem;
  margin-inline: auto;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 50px;
  padding-inline: 1.1em;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: filter 0.15s ease;
}
.pill:hover,
.pill:focus-visible {
  filter: brightness(1.12);
}
.pill svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}
.pill-linkedin {
  background: #0a66c2;
  color: #fff;
}
.pill-github {
  background: #24292f;
  color: #fff;
}
.pill-journal {
  background: var(--accent);
  color: var(--accent-fg);
}
.pill-x {
  background: #0b0b0d;
  color: #fff;
}

.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 24px;
}
.site-footer-inner {
  max-width: 72rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 13px;
  color: var(--muted);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  text-decoration: none;
  color: var(--fg);
  font-family: "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;
  font-style: normal;
  font-size: 28px;
  line-height: 1;
}
.footer-brand .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--point);
}
.loader-credit {
  font-size: 11px;
}

@media (max-width: 480px) {
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
