/* ==========================================================================
   Advait personal site
   One stylesheet for every page. Edit the tokens in :root to retheme.
   ========================================================================== */

:root {
  /* Colors */
  --bg: #0E0E0E;            /* page background */
  --surface: #151515;       /* image placeholders */
  --border: #1C1C1C;        /* image borders */
  --border-hover: #333333;
  --footer-bg: #1E1E1E;     /* revealed footer */
  --footer-dot: #1A1A1A;    /* dot pattern, a shade darker than the footer */
  --text: #EDEDED;          /* all body text */
  --text-strong: #FFFFFF;
  --label: #8A8A8A;         /* small caps labels */
  --muted: #6E6E6E;         /* superscript numbers */
  --underline: #5A5A5A;     /* dotted link underline */
  --accent: #FFD60A;        /* link arrows, version tag */
  --rule: rgba(237, 237, 237, 0.14); /* header line */

  /* Type */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-size: 14px;
  --label-size: 11px;

  /* Layout */
  --gutter: 24px;           /* left/right page margin */
  --col-gap: 16px;          /* gap between the 3 columns */
  --section-gap: 36px;
  --footer-h: 260px;        /* height of the revealed footer */
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-size);
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

p { margin: 0; }
img { display: block; max-width: 100%; }

/* ---------- Links ---------- */

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--text-strong); }

/* Any link with an arrow gets the dotted underline */
a.ext {
  text-decoration: underline dotted;
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
}
a.ext:hover { text-decoration-color: var(--accent); }
a.ext::after {
  content: "↗";
  color: var(--accent);
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
}

sup.num { color: var(--muted); font-size: 0.7em; margin-left: 1px; }

.fit { width: fit-content; }

/* ---------- Labels (the small gray caps) ---------- */

.label {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0;
}

/* ---------- Page shell + footer reveal ---------- */

/* The page sits on top of a fixed footer. Its bottom margin equals the
   footer's height, so scrolling to the end slides the page up and
   uncovers the footer, as if it was always there. */
.page {
  position: relative;
  z-index: 1;
  background: var(--bg);
  margin-bottom: var(--footer-h);
  padding: 20px var(--gutter) 48px;
  min-height: 100vh;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--rule);
}
.site-header .name { font-size: 15px; font-weight: 600; }
.site-header .loc { display: none; }  /* only shown in the 3-column layout */

/* ---------- Home: intro ---------- */

.intro {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lists {
  display: flex;
  gap: 40px;
}

.list { display: flex; flex-direction: column; gap: 2px; }
.list .label { margin-bottom: 14px; }

/* ---------- Home: project grid ---------- */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px var(--col-gap);
  align-items: start;      /* cards line up at the top; heights can differ */
}

.card { display: flex; flex-direction: column; gap: 12px; }
.card .meta { display: flex; flex-direction: column; gap: 2px; }

.thumb {
  aspect-ratio: auto;      /* real images keep their own height */
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.3s;
}
.thumb img { width: 100%; height: auto; }
.thumb.placeholder { aspect-ratio: 16 / 10; }  /* empty slots keep a default shape */
.card:hover .thumb { border-color: var(--border-hover); transform: translateY(-2px); }

/* Placeholder look for any image box without an image yet */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4A4A4A;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- Project page ---------- */

.back { width: fit-content; }

.media {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.ratio-cover { aspect-ratio: 16 / 8; }
.ratio-wide { aspect-ratio: 16 / 9; }
.ratio-photo { aspect-ratio: 4 / 3; }

.overview {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.overview .summary {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.overview h1 { margin: 0; font-size: var(--text-size); font-weight: 600; }
.title-block { display: flex; flex-direction: column; gap: 2px; }
.outbound { display: flex; flex-wrap: wrap; gap: 24px; }

.details {
  margin: 0;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 16px;
  align-content: start;
}
.details dt { padding-top: 3px; }
.details dd { margin: 0; }

.case {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.case-text {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.figures-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }

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

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: var(--footer-h);
  padding: 44px var(--gutter) 0;
  background-color: var(--footer-bg);
  background-image: radial-gradient(circle, var(--footer-dot) 1px, transparent 1.5px);
  background-size: 14px 14px;
}

.footer-inner { display: flex; flex-direction: column; gap: 32px; }
.footer-block { display: flex; flex-direction: column; gap: 12px; }
.footer-row { display: flex; align-items: center; gap: 16px; }

.version {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 10px;
}

button.version {
  background: transparent;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

/* ---------- Neofetch panel (shelved: see shelved/fetch.js) ---------- */

/* Panels float just above the version tag, over the bottom of the page,
   so the footer itself can stay short. */
.fetch {
  position: fixed;
  z-index: 5;
  left: var(--gutter);
  bottom: calc(var(--footer-h) - 36px);
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid #2A2A2A;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  max-width: calc(100vw - 2 * var(--gutter));
}
.fetch[hidden] { display: none; }
.fetch-logo {
  margin: 0;
  font: inherit;
  line-height: 1.2;
  color: var(--accent);
}
.fetch-info { display: flex; flex-direction: column; }
.fetch-line { white-space: nowrap; }
.fetch-key { color: var(--accent); }
.fetch-k { display: inline-block; min-width: 76px; }
.fetch-rule { color: #3A3A3A; }
.fetch-blocks { display: flex; margin-top: 10px; }
.fetch-blocks span { width: 22px; height: 12px; }

/* Line-by-line print */
.fetch .fetch-line,
.fetch .fetch-logo { opacity: 0; transform: translateY(2px); transition: opacity 0.12s, transform 0.12s; }
.fetch .on { opacity: 1; transform: none; }

/* ---------- Changelog panel (js/changelog.js) ---------- */

button.updated {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline dotted;
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
}
button.updated:hover,
button.updated[aria-expanded="true"] { text-decoration-color: var(--accent); }
button.updated:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

.changelog {
  position: fixed;
  z-index: 5;
  left: var(--gutter);
  bottom: calc(var(--footer-h) - 36px);
  width: 440px;
  max-width: calc(100vw - 2 * var(--gutter));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid #2A2A2A;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}
.changelog[hidden] { display: none; }
.log-entry { display: flex; flex-direction: column; gap: 2px; }
.log-head { display: flex; gap: 12px; align-items: baseline; }
.log-plus { color: var(--muted); }

/* ---------- Layout: 1 column by default, 3 columns on wide screens ----------
   On wide screens the page is three uniform columns from header to footer:
     header   Advait          | CS Student @ Purdue | West Lafayette, IN
     intro    About           | Experience          | Links
     grid     project         | project             | project
     footer   version, date   | GitHub, LinkedIn    | Let's build...
   `display: contents` lets nested wrappers drop their children straight
   into the shared grid, so everything lines up on the same column edges. */

@media (min-width: 900px) {
  :root { --footer-h: 150px; }

  .site-header,
  .intro,
  .grid,
  .footer-inner,
  .overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }

  .site-header { row-gap: 0; }
  .site-header .loc { display: block; }

  .intro { row-gap: 0; align-items: start; }
  .about { max-width: none; padding-right: var(--col-gap); }
  .lists { display: contents; }

  .grid { row-gap: 24px; }

  .footer-inner { row-gap: 0; align-items: start; }
  .footer-block { display: contents; }

  .overview { row-gap: 0; }
  .overview .summary { grid-column: 1 / span 2; max-width: 640px; }

}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .figures-2 { grid-template-columns: minmax(0, 1fr); }
  .details { grid-template-columns: 100px minmax(0, 1fr); }
  .fetch { right: var(--gutter); flex-direction: column; gap: 12px; padding: 16px; overflow-x: auto; }
  .fetch-logo { display: none; }
  .changelog { right: var(--gutter); width: auto; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
