/* akshaysinha.me
   Layout idea: an instrument panel on a drafting grid. Mono readouts label everything,
   the serif carries the voice, and there is one accent colour. Single dark theme by choice. */
:root {
  --ink: #0c0e11;
  --panel: #12151a;
  --paper: #ece8dd;
  --muted: #9b9da5;
  --line: #272b33;
  --accent: #d3b05c; /* swap this one value to re-colour the whole site */
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(236, 232, 221, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(236, 232, 221, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent); color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: rgba(12, 14, 17, 0.86); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 16px; padding-bottom: 16px; }
.mark { font-family: var(--mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.nav a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--paper); }

/* Load sequence: one orchestrated moment, resting state is fully visible */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(211, 176, 92, 0.5); } 60% { box-shadow: 0 0 0 7px rgba(211, 176, 92, 0); } }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  html { scroll-behavior: auto; }
}

/* Hero */
.hero { border-bottom: 1px solid var(--line); background: radial-gradient(ellipse 60% 70% at 78% 40%, rgba(211, 176, 92, 0.07), transparent 70%); }
.hero .wrap.top { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px 64px; align-items: end; padding-top: 84px; padding-bottom: 60px; }
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin: 0 0 26px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .status i { animation: none; } }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 76px); line-height: 1.03; letter-spacing: -0.01em; margin: 0; max-width: 18ch; text-wrap: balance; }
h1 em { font-style: italic; color: var(--accent); }
.lede { max-width: 52ch; margin: 28px 0 0; font-size: 19px; color: var(--paper); }
.cta { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 32px; }
.cta a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; padding: 11px 16px; border: 1px solid var(--line); background: var(--panel); transition: border-color 0.2s, color 0.2s; }
.cta a:hover { border-color: var(--accent); }
.cta a.primary { border-color: var(--accent); color: var(--accent); }

/* Portrait with crop marks */
.portrait { margin: 0; }
.portrait .frame {
  padding: 10px;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 16px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 1px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 16px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 1px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 16px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 1px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 16px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 1px 16px no-repeat;
}
.portrait img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(1) contrast(1.06); }
.portrait figcaption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); margin-top: 12px; font-size: 11px; }

/* Readout strip under the hero */
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.readout div { padding: 22px 24px 24px 0; }
.readout div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.readout dt { color: var(--accent); font-size: 11px; margin: 0 0 6px; }
.readout dd { margin: 0; font-family: var(--display); font-size: clamp(22px, 2.3vw, 28px); line-height: 1.15; }
dl.readout { margin: 0; }

/* Rails: horizontal lists for work, writing and press */
.rail-sec { border-bottom: 1px solid var(--line); padding: 64px 0 56px; scroll-margin-top: 56px; }
.rail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.rail-head h2 { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0; white-space: nowrap; }
.rail-head h2::before { content: "[ "; color: var(--muted); }
.rail-head h2::after { content: " ]"; color: var(--muted); }
.rail-head .count { color: var(--muted); font-size: 11px; }
.rail-head .all { margin-left: auto; font-size: 11px; }
.ctrl { display: flex; gap: 8px; margin-left: auto; }
.rail-head .all + .ctrl { margin-left: 8px; }
.ctrl button { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--panel); color: var(--paper); font-family: var(--mono); font-size: 15px; cursor: pointer; transition: border-color 0.2s, color 0.2s, opacity 0.2s; }
.ctrl button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ctrl button:disabled { opacity: 0.3; cursor: default; }
.ctrl button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-inline: max(24px, calc((100% - 1120px) / 2 + 24px)); scroll-padding-inline: max(24px, calc((100% - 1120px) / 2 + 24px)); }
.rail::-webkit-scrollbar { display: none; }
.rail:focus-visible { outline: 1px solid var(--accent); outline-offset: 6px; }
.card { position: relative; overflow: hidden; flex: 0 0 min(84%, 348px); scroll-snap-align: start; display: flex; flex-direction: column; min-height: 268px; padding: 22px 22px 20px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: border-color 0.25s, transform 0.25s, background-color 0.25s; }
a.card::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease; }
a.card:hover, a.card:focus-visible { border-color: rgba(211, 176, 92, 0.55); transform: translateY(-3px); background-color: #161a20; color: inherit; }
a.card:hover::before, a.card:focus-visible::before { transform: scaleX(1); }
.card .go { transition: color 0.25s, transform 0.25s; }
a.card:hover .go, a.card:focus-visible .go { transform: translateX(4px); }
a.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.key { border-color: rgba(211, 176, 92, 0.6); background: linear-gradient(180deg, rgba(211, 176, 92, 0.07), transparent 60%), var(--panel); }
.card .top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.card .top b { font-weight: 500; color: var(--accent); }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 34px 0 10px; text-wrap: balance; }
.card.small h3 { font-size: 24px; line-height: 1.16; margin-top: 26px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.card .go { margin-top: auto; padding-top: 22px; font-size: 11px; color: var(--paper); }
a.card:hover .go { color: var(--accent); }
.prog { position: relative; height: 1px; background: var(--line); margin-top: 28px; }
.prog i { position: absolute; top: -1px; height: 3px; left: 0; width: 30%; background: var(--accent); }
.rail-sec.fits .ctrl, .rail-sec.fits .prog { display: none; }

/* Press tags and pull quotes */
.card .tag { border: 1px solid var(--line); padding: 2px 7px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.card .tag.q { border-color: rgba(211, 176, 92, 0.5); background: rgba(211, 176, 92, 0.08); color: var(--accent); }
.card p.quote { font-family: var(--display); font-style: italic; font-size: 19px; line-height: 1.3; color: var(--paper); opacity: 0.82; }
.card.press h3 { margin-bottom: 12px; }

/* Rails show whole cards: 3 on desktop, 2 on tablet, 1 plus a peek on phones */
@media (min-width: 641px) {
  .rail { width: min(1072px, 100% - 48px); margin-inline: auto; padding: 6px 0 4px; scroll-padding-inline: 0; }
  .card { flex-basis: calc((100% - 16px) / 2); }
}
@media (min-width: 1000px) {
  .card { flex-basis: calc((100% - 32px) / 3); }
}
@media (prefers-reduced-motion: reduce) {
  .card, a.card::before, .card .go { transition: none; }
  a.card:hover, a.card:focus-visible, a.card:hover .go { transform: none; }
}

/* Writing index grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid .card { flex: none; }
.page-head { padding: 72px 0 36px; }
.page-head h1 { font-size: clamp(36px, 5vw, 60px); max-width: 18ch; }
.page-body { padding-bottom: 72px; border-bottom: 1px solid var(--line); }

/* Footer */
.site-foot .wrap { padding-top: 56px; padding-bottom: 48px; }
.elsewhere { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 0 0 40px; padding: 0; list-style: none; }
.elsewhere a { font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px); text-decoration: none; line-height: 1.15; }
.elsewhere a::after { content: " ↗"; font-family: var(--mono); font-size: 0.45em; color: var(--accent); vertical-align: super; }
.earlier { color: var(--muted); font-size: 11px; margin: 0 0 36px; line-height: 1.9; }
.fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 18px; }

/* Article */
.article .wrap { max-width: 780px; padding-top: 64px; padding-bottom: 72px; }
.crumbs { color: var(--muted); margin: 0 0 26px; font-size: 11px; }
.crumbs a { text-decoration: none; }
.article h1 { font-size: clamp(36px, 5.4vw, 58px); max-width: 20ch; }
.article .standfirst { font-size: 20px; color: var(--muted); margin: 22px 0 14px; max-width: 58ch; }
.article .meta { color: var(--muted); font-size: 11px; margin: 0 0 40px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article .body { max-width: 66ch; }
.article .body h2 { font-family: var(--display); font-weight: 400; font-size: 31px; line-height: 1.2; margin: 46px 0 12px; }
.article .body p { margin: 0 0 18px; }
.article .body ul { padding-left: 20px; margin: 0 0 18px; }
.article .body li { margin-bottom: 8px; }
.article .body blockquote { margin: 30px 0; padding: 4px 0 4px 22px; border-left: 1px solid var(--accent); font-family: var(--display); font-size: 26px; line-height: 1.28; }
.article .body code { font-family: var(--mono); font-size: 0.86em; background: var(--panel); border: 1px solid var(--line); padding: 1px 5px; }
.article .body pre { background: var(--panel); border: 1px solid var(--line); padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.note { border: 1px dashed var(--accent); background: var(--panel); padding: 14px 16px; font-size: 15px; margin: 0 0 34px; max-width: 66ch; }
.byline { border-top: 1px solid var(--line); margin-top: 52px; padding-top: 22px; color: var(--muted); font-size: 16px; max-width: 66ch; }

@media (max-width: 860px) {
  body { font-size: 16px; background-size: 48px 48px; }
  .hero .wrap.top { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 40px; gap: 32px; }
  .portrait { max-width: 200px; }
  .readout { grid-template-columns: 1fr; }
  .readout div { padding: 16px 0; }
  .readout div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .rail-sec { padding: 44px 0 40px; }
  .rail-head .all { display: none; }
  .card { min-height: 236px; }
  .card h3 { font-size: 27px; margin-top: 26px; }
  .nav { gap: 4px 16px; }
  .page-head { padding: 44px 0 28px; }
}
