/*
 * AYAAN RETIWALA — PERSONAL SITE
 * ================================
 * Concept: "Architect's project log" — a warm, editorial document where
 * confident serif headlines meet monospace technical detail. Inspired by
 * the ampcode.com approach: large italic display type, structural mono
 * labels, warm depth in the palette. Adapted for a personal portfolio
 * rather than a product page.
 *
 * The hook: the italic serif name/domain headings set against crisp
 * monospace body text, on a palette that feels like aged paper by
 * lamplight. It reads like you found someone's beautifully kept
 * engineering notebook.
 */


/* ============================================
   DESIGN TOKENS
   ============================================ */

:root {
  /*
   * Light mode: warm parchment. Not pure white (clinical),
   * not cream-yellow (too nostalgic). A paper with warmth.
   */
  --bg:            #f2efe8;
  --bg-raised:     #e9e5db;
  --text:          #252220;
  --text-mid:      #5e564d;
  --text-quiet:    #928a7f;
  --accent:        #6b7c5e;     /* muted olive — earthy, warm, not the usual blue */
  --accent-strong: #4e5e42;
  --accent-glow:   #6b7c5e22;
  --rule:          #d4cfc5;
  --rule-faint:    #e2ddd4;

  /* Type */
  --font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono:     'IBM Plex Mono', 'SF Mono', 'Consolas', monospace;

  /* Scale — slightly larger base for readability in mono */
  --fs-xs:   0.7rem;
  --fs-sm:   0.82rem;
  --fs-base: 0.95rem;
  --fs-md:   1.15rem;
  --fs-lg:   1.55rem;
  --fs-xl:   2.4rem;
  --fs-2xl:  clamp(2.8rem, 6vw, 4.2rem);

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-8:  3rem;
  --sp-10: 4.5rem;
  --sp-14: 4.5rem;

  /* Motion */
  --ease:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.55s;
}

/*
 * Dark mode: deep warm forest, not cold blue-black.
 * Same notebook, read under a warm desk lamp in a cabin.
 * The olive accent becomes lighter/warmer to maintain contrast.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #151a14;
    --bg-raised:     #1e241c;
    --text:          #e2ddd0;
    --text-mid:      #a09882;
    --text-quiet:    #6e6758;
    --accent:        #9aad7e;
    --accent-strong: #b5c89a;
    --accent-glow:   #9aad7e15;
    --rule:          #2e342a;
    --rule-faint:    #242a21;
  }
}


/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-base);
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  max-width: 780px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  background: var(--accent);
  color: var(--bg);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: var(--sp-4); }


/* ============================================
   LINKS
   ============================================ */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-strong); }


/* ============================================
   HEADER
   ============================================ */

.header {
  margin-bottom: var(--sp-10);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--rule);
}

/*
 * The label above the name: small uppercase mono.
 * Mirrors ampcode's "INSTALL AMP" / "SOCIAL" pattern.
 * Structural scaffolding — tells you what this section IS
 * without needing visual weight.
 */
.header__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

/*
 * The name: large Playfair Display with the last name in italic.
 * WHY italic on the last name? It creates visual movement and
 * personality — the same trick ampcode uses with "Engineered
 * For The Frontier." The upright first name + italic last name
 * creates a conversational rhythm. Also: it's YOUR name. It
 * should be the most expressive thing on the page.
 */
.header__name {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--sp-5);
}

.header__name em {
  font-style: italic;
}

.header__name-first {
  display: block;
}

.header__summary {
  font-size: var(--fs-base);
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 540px;
  margin-bottom: var(--sp-5);
}

.header__summary strong {
  font-weight: 500;
  color: var(--accent);
}

.header__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
}

.header__links a {
  color: var(--text-mid);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.header__links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}


/* ============================================
   SECTION LABELS
   
   Small uppercase monospace — the structural bones.
   Inspired by ampcode's section labels. These don't
   need to be big; they orient you without visual weight.
   ============================================ */

.section {
  margin-bottom: var(--sp-10);
}

.section__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-quiet);
  margin-bottom: var(--sp-5);
}

.section__aside {
  font-size: var(--fs-xs);
  color: var(--text-quiet);
  font-style: italic;
  font-family: var(--font-mono);
  margin-top: calc(-1 * var(--sp-3));
  margin-bottom: var(--sp-6);
}


/* ============================================
   FLUENCIES
   
   Definition list: domain label + technologies.
   Using <dl> because it IS a definition relationship.
   Two columns on desktop, stacked on mobile.
   ============================================ */

.fluency-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4) var(--sp-8);
}

.fluency-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.fluency-group dt {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.fluency-group dd {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.65;
}


/* ============================================
   WORK — DOMAIN GROUPS + ENTRIES
   ============================================ */

.work-domain {
  margin-bottom: var(--sp-8);
}

/*
 * Domain headings: Playfair italic, with a thin extending line.
 * The italic serif at this mid-size creates visual warmth between
 * the tiny mono section labels and the larger project entry titles.
 * The extending line gives editorial structure — like a chapter divider.
 */
.domain-heading {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.domain-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* 
 * Work entries: left-bordered with accent on hover.
 * The left border is the "spine" of the notebook. Hover brings
 * it to life — a subtle acknowledgment that this content is interactive.
 */
.entry {
  margin-bottom: var(--sp-6);
  padding-left: var(--sp-5);
  border-left: 2px solid var(--rule-faint);
  transition: border-color 0.3s var(--ease);
  /* reveal animation */
  opacity: 0;
  transform: translateY(10px);
  transition: border-color 0.3s var(--ease),
              opacity var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

.entry.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.entry:hover {
  border-left-color: var(--accent);
}

.entry__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

/*
 * Entry titles: Playfair Display, regular weight.
 * Large enough to anchor the entry, but not italic —
 * italic is reserved for domain headings and the hero name
 * to keep a clear hierarchy.
 */
.entry__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.entry__time {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-quiet);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.entry__desc {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  margin-bottom: var(--sp-3);
  line-height: 1.72;
}

.entry__list {
  list-style: none;
  margin-bottom: var(--sp-3);
}

/* Em-dash list markers — more considered than generic bullets */
.entry__list li {
  font-size: var(--fs-xs);
  color: var(--text-mid);
  line-height: 1.75;
  padding-left: var(--sp-4);
  position: relative;
}

.entry__list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-quiet);
}

.entry__tech {
  font-size: var(--fs-xs);
  color: var(--text-quiet);
  letter-spacing: 0.02em;
}


/* ============================================
   EXPERIENCE — TIMELINE ENTRIES
   ============================================ */

.timeline-entry {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--rule-faint);
  /* reveal */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.timeline-entry.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-entry:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.timeline-entry__side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--text-quiet);
  padding-top: 0.35rem; /* align with title baseline */
}

.timeline-entry__role {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--sp-1);
}

.timeline-entry__level {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-quiet);
  vertical-align: super;
  margin-left: var(--sp-1);
}

.timeline-entry__co {
  font-size: var(--fs-sm);
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.timeline-entry__note {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.72;
}


/* ============================================
   EDUCATION
   ============================================ */

.edu {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.edu.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.edu__degree {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.edu__where {
  font-size: var(--fs-sm);
  color: var(--text-mid);
}


/* ============================================
   FOOTER
   ============================================ */

.footer {
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--rule-faint);
  font-size: var(--fs-xs);
  color: var(--text-quiet);
  text-align: center;
  letter-spacing: 0.04em;
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  body {
    padding: var(--sp-8) var(--sp-4);
  }

  .header {
    margin-bottom: var(--sp-10);
  }

  .fluency-list {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .timeline-entry__side {
    flex-direction: row;
    gap: var(--sp-3);
    padding-top: 0;
  }

  .entry__head {
    flex-direction: column;
    gap: 0;
  }

  .entry__time {
    margin-bottom: var(--sp-2);
  }
}


/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .entry:hover {
    transition: none;
  }
}
