/* Daksh Shami, personal site. Recreated from the Claude Design handoff
   ("Broadsheet" design system). Source Serif 4 throughout, no sans-serif. */

:root {
  --bg: #f3f2f2;
  --text: #201e1d;
  --accent: #0088b0;
  --accent-600: #1186ac;
  --accent-700: #006786; /* small accent text and links, 4.5:1 safe */
  --accent-900: #0a303e;
  --muted-78: color-mix(in srgb, var(--text) 78%, transparent);
  --muted-70: color-mix(in srgb, var(--text) 70%, transparent);
  --leader: color-mix(in srgb, var(--text) 45%, transparent);
  --divider: color-mix(in srgb, var(--text) 16%, transparent);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 28px;
  text-wrap: pretty;
}

h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0; }
p { margin: 0; }
figure { margin: 0; }
img { display: block; max-width: 100%; }

a {
  color: var(--accent-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-900); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* One shared content width (900px) so text, rules, CV and footer all end on
   the same right edge. */
.page {
  --gutter: clamp(20px, 5vw, 72px);
  max-width: calc(900px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Small-caps style labels (nav, kickers, CV group labels) */
.caps {
  font-size: 13px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Thick-thin newspaper rule pair */
.rule-pair {
  height: 5px;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--text);
}

/* 1. Header */
.masthead {
  padding-top: clamp(48px, 7vw, 84px);
  text-align: center;
}
.masthead h1 {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.role {
  margin: 16px 0 40px;
  font-size: 20px;
  line-height: 28px;
  color: var(--muted-78);
}
.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 48px;
  padding: 14px 0;
}
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--accent-900); }
.rule-thin { border-top: 1px solid var(--text); }

/* 2. Intro */
.intro { padding: 84px 0; }
.intro-inner { display: flow-root; max-width: 900px; }
.headshot {
  float: left;
  width: clamp(180px, 40%, 360px);
  margin: 6px clamp(28px, 5vw, 56px) 28px 0;
}
.headshot img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.quote {
  margin: 0;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-indent: -0.475em; /* hang the opening quote mark */
}
.attribution {
  margin-top: 20px;
  font-size: 15.5px;
  line-height: 28px;
  color: var(--muted-70);
}
.bio p { margin-top: 14px; }
.bio p:first-child { margin-top: 48px; }

/* 3. Featured paper */
.paper { padding: 0 0 96px; }
.kicker-accent {
  display: block;
  color: var(--accent-700);
  margin-bottom: 20px;
}
.paper h2 {
  max-width: 900px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.abstract {
  columns: 2 320px;
  column-gap: 56px;
  max-width: 900px;
  margin-top: 28px;
  font-size: 15.5px;
  line-height: 28px;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.abstract p + p { margin-top: 14px; }
.abstract sup { font-size: 0.72em; line-height: 0; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* Buttons (Broadsheet .btn) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 2px;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-600); color: var(--bg); }
.btn-primary:active { background: var(--accent-700); }
.btn-secondary { border-color: var(--divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.btn-secondary:active { background: color-mix(in srgb, var(--text) 14%, transparent); }

/* 4. CV */
.cv {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 72px;
  padding: 0 0 96px;
}
.cv-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  flex: 1 1 200px;
  max-width: 280px;
}
.muted-label { color: var(--muted-70); }
.cv-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 3 1 540px; /* wide enough that the longest row never wraps beside the aside */
  min-width: 0;
}
.cv-groups h3 {
  margin: 0;
  font-weight: 400;
  line-height: 28px;
  color: var(--muted-70);
}
.row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 15.5px;
  line-height: 28px;
}
.leader {
  flex: 1 1 0;
  min-width: 0;
  align-self: flex-end;
  margin-bottom: 0.34em;
  border-bottom: 1px dotted var(--leader);
}
.date { white-space: nowrap; }
.date-accent { color: var(--accent-700); }

/* 5. Footer */
.footer { padding: 0 0 56px; }
.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding-top: 20px;
  font-size: 15.5px;
  line-height: 28px;
}

/* Phones: un-float the photo so the quote is not squeezed beside it */
/* Narrow screens: the role line becomes a two-line block exactly as wide as
   the name. The lockup shrinks to the name's width (the role is an inline-size
   container, so it adds no width of its own), and each line's font-size is set
   in container units from the font's measured widths in Source Serif 4:
   "PhD student in Computer Science," = 16.19em, "University of
   Wisconsin-Madison" = 15.72em over 31 characters, so the second line takes
   0.015em letter-spacing to end on the same edge. */
@media (max-width: 680px) {
  .lockup { width: fit-content; margin-inline: auto; }
  .role {
    container-type: inline-size;
    margin: 12px 0 32px;
  }
  .role-line {
    display: block;
    white-space: nowrap;
    font-size: 16px; /* fallback without container units */
    font-size: calc(100cqi / 16.19);
    line-height: 1.45;
  }
  .role-line + .role-line { letter-spacing: 0.015em; }
}

@media (max-width: 480px) {
  .headshot {
    float: none;
    width: 100%;
    margin: 0 0 32px;
  }
  .intro { padding: 56px 0 72px; }
  .abstract { text-align: left; }
  .paper, .cv { padding-bottom: 72px; }
}
