/* Shoaib Rain — personal site.
   One column, one typeface, no JavaScript. Hierarchy comes from weight and
   whitespace rather than size. Theme follows the operating system. */

:root {
  /* Declaring this stops Chrome's auto-dark-mode from re-processing the page
     and shading the body box differently from the canvas behind it. */
  color-scheme: light dark;

  --bg: #ffffff;
  --heading: #101828;
  --prose: #1e2939;
  --link: #0f6e56;
  --link-hover: #0c5c48;
  --decoration: transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --heading: #e4e4e7;
    --prose: #d4d4d8;
    --link: #a1a1aa;
    --link-hover: #d4d4d8;
    --decoration: #3f3f46;
  }
}

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

html {
  min-width: 360px;
  scrollbar-gutter: stable;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--prose);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.375;
  letter-spacing: -0.025em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 60ch;
  margin-inline: auto;
  padding: 0 2rem 2rem;
}

@media (min-width: 768px) {
  main { padding-top: 2rem; }
}

.avatar {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-top: 3rem;
  object-fit: cover;
}

h1 {
  color: var(--heading);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 1rem 0 0;
  text-wrap: balance;
}

p {
  margin: 1.5rem 0 0;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--decoration);
  text-underline-offset: 2px;
  transition: color 200ms;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
}

/* Short viewports: tighten the rhythm so the page still holds one screen. */
@media (max-height: 720px) {
  main { padding-bottom: 0.5rem; }
  .avatar { margin-top: 1rem; }
  p { margin-top: 1rem; }
  footer { margin-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
