/* Shiva Saxena, personal site. Hand-written. */

:root {
  --paper: #f4eee3;
  --paper-2: #ebe3d4;
  --ink: #1b1714;
  --ink-2: #4a423c;
  --muted: #7d736a;
  --rule: rgba(27, 23, 20, 0.14);
  --accent: #b6431d;
  --accent-ink: #8f3315;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --devanagari: "Tiro Devanagari Hindi", serif;

  --measure: 62ch;
  --max: 1120px;
  --gutter: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151311;
    --paper-2: #1d1a17;
    --ink: #ece4d6;
    --ink-2: #c9bfae;
    --muted: #8f8577;
    --rule: rgba(236, 228, 214, 0.14);
    --accent: #e0673d;
    --accent-ink: #f08a63;
  }
}
:root[data-theme="dark"] {
  --paper: #151311;
  --paper-2: #1d1a17;
  --ink: #ece4d6;
  --ink-2: #c9bfae;
  --muted: #8f8577;
  --rule: rgba(236, 228, 214, 0.14);
  --accent: #e0673d;
  --accent-ink: #f08a63;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

/* Underline that draws in from the left */
.text-link,
.what a,
.shelf a,
.site-footer a,
.social a,
.big-link a,
.lede a {
  position: relative;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease), color 0.2s;
}
.text-link:hover,
.what a:hover,
.shelf a:hover,
.site-footer a:hover,
.social a:hover,
.big-link a:hover {
  color: var(--accent);
  background-size: 0% 1px;
  background-position: 100% 100%;
}

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

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px var(--gutter) 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 20px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-variation-settings: "opsz" 24;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: clamp(14px, 2.5vw, 28px);
  font-size: 0.92rem;
  color: var(--ink-2);
}
.site-nav a {
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.mantra {
  font-family: var(--devanagari);
  color: var(--accent);
  font-size: 1.05rem;
  justify-self: end;
  letter-spacing: 0.02em;
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 10vh, 120px) var(--gutter) clamp(72px, 12vh, 140px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(3rem, 7.2vw, 6rem);
  line-height: 0.98;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-weight: 300;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
}

.creed {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.55em;
  row-gap: 4px;
  margin-bottom: 30px;
}
.creed span + span::before {
  content: "·";
  color: var(--accent);
  margin-right: 0.55em;
  font-style: normal;
}

.lede {
  max-width: var(--measure);
  font-size: 1.1rem;
  color: var(--ink-2);
  margin-bottom: 36px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.25s var(--ease), color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.text-link {
  font-size: 0.95rem;
  color: var(--ink-2);
}

/* Portrait: a plain headshot in a softly rounded frame. Nothing clever. */
.portrait {
  margin: 0;
  justify-self: end;
  align-self: center;
  width: min(100%, 400px);
  aspect-ratio: 4 / 5;
  position: relative;
}
.portrait .frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 30px 60px -36px rgba(27, 23, 20, 0.5);
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1.02);
  will-change: transform;
  filter: saturate(0.9) contrast(1.02);
  transition: filter 0.6s var(--ease);
}
.portrait:hover img { filter: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .portrait .frame { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
  :root:not([data-theme="light"]) .portrait img { filter: brightness(0.86) saturate(0.85) contrast(1.04); }
  :root:not([data-theme="light"]) .portrait:hover img { filter: brightness(0.94) saturate(0.95); }
}
:root[data-theme="dark"] .portrait .frame { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
:root[data-theme="dark"] .portrait img { filter: brightness(0.86) saturate(0.85) contrast(1.04); }
:root[data-theme="dark"] .portrait:hover img { filter: brightness(0.94) saturate(0.95); }

/* ---------- Blocks ---------- */

.block {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 8vh, 96px) var(--gutter);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}

.block-head {
  position: sticky;
  top: 32px;
}
.num {
  display: block;
  font-family: var(--serif);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
h2 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.05;
  font-variation-settings: "opsz" 72;
  margin-bottom: 14px;
}
.block-note {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 30ch;
}

/* Compass */

.compass {
  margin: 0;
  display: grid;
  gap: 0;
}
.compass > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  transition: padding-left 0.35s var(--ease);
}
.compass > div:first-child { border-top: 0; padding-top: 0; }
.compass > div:hover { padding-left: 10px; }
.compass dt {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
  font-variation-settings: "opsz" 36;
}
.compass > div:hover dt { color: var(--accent); }
.compass dd {
  margin: 0;
  color: var(--ink-2);
}

/* Timeline */

.timeline {
  list-style: none;
  display: grid;
  gap: 0;
}
.timeline > li {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.timeline > li:first-child { border-top: 0; padding-top: 0; }

.when {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--muted);
  padding-top: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dash {
  font-style: italic;
  color: var(--rule);
  color: var(--muted);
  opacity: 0.7;
  margin: 0 2px;
}

.what h3 {
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: 10px;
  font-variation-settings: "opsz" 36;
}
.what h3 small {
  display: block;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.01em;
}
.what .x { color: var(--accent); font-weight: 300; margin: 0 2px; }
.what p { color: var(--ink-2); max-width: var(--measure); }
.what p + ul, .what p + p { margin-top: 12px; }
.what ul {
  list-style: none;
  max-width: var(--measure);
  color: var(--ink-2);
  display: grid;
  gap: 10px;
}
.what ul li {
  padding-left: 18px;
  position: relative;
}
.what ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 1px;
  background: var(--accent);
}
.grade {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 8px !important;
}
.verify {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 12px;
  background-size: 100% 1px;
}
.verify:hover { color: var(--accent); }

/* Toolbox */

.toolbox {
  grid-column: 2;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.toolbox h3 {
  font-size: 1.1rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 18px;
}
.tools {
  display: grid;
  gap: 10px;
  color: var(--ink-2);
  font-size: 0.98rem;
}
.tools > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
}
.tools .label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

/* Shelf */

.shelf {
  list-style: none;
  display: grid;
  gap: 28px;
}
.shelf h3 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  font-variation-settings: "opsz" 36;
}
.shelf p { color: var(--ink-2); max-width: var(--measure); }
.shelf .meta {
  margin-top: 14px;
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
}

/* Hello */

.hello { padding-bottom: clamp(48px, 8vh, 80px); }
.big-link {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
  overflow-wrap: anywhere;
}
.big-link a { background-size: 100% 2px; }
.big-link a:hover { background-size: 0% 2px; }
.social {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  color: var(--ink-2);
}

/* Footer */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .mantra { font-size: 1.2rem; }

/* ---------- Motion ---------- */

.rise {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s var(--ease) forwards;
}
.hero-text .rise:nth-child(1) { animation-delay: 0.05s; }
.hero-text .rise:nth-child(2) { animation-delay: 0.15s; }
.hero-text .rise:nth-child(3) { animation-delay: 0.28s; }
.hero-text .rise:nth-child(4) { animation-delay: 0.40s; }
.hero-text .rise:nth-child(5) { animation-delay: 0.52s; }
.portrait.rise { animation-delay: 0.25s; transform: translateY(12px) scale(0.985); }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .portrait img { transform: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }
  .portrait {
    order: -1;
    justify-self: stretch;
    width: 100%;
    aspect-ratio: 1 / 1.08;
  }
  .block {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .block-head { position: static; }
  .block-note { max-width: var(--measure); }
  .toolbox { grid-column: 1; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 14px;
  }
  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .mantra { justify-self: end; }
  .compass > div { grid-template-columns: 1fr; gap: 8px; }
  .timeline > li { grid-template-columns: 1fr; gap: 8px; }
  .when { padding-top: 0; }
  .tools > div { grid-template-columns: 1fr; gap: 2px; }
}
