/* ==========================================================================
   AkhilJ.ca — base.css  (Version 2 identity)
   Tokens, reset, typography and layout utilities.

   Global identity = the gallery around the work:
   warm paper, soft white, charcoal ink, warm grey, hairlines,
   and ONE restrained accent (muted wine) used sparingly.
   Projects carry their own colour; the global brand stays quiet.
   Never reintroduce electric blue / coral / loud gradients here,
   and never borrow OmniPhi's cream / gold / serif identity.
   ========================================================================== */

:root {
  /* ---- Colour ---- */
  --paper: #F4F2EE;
  --paper-2: #EBE8E2;
  --surface: #FBFAF8;
  --ink: #171614;
  --ink-2: #3B3935;
  --muted: #6E6963;
  --line: rgba(23, 22, 20, 0.12);
  --line-strong: rgba(23, 22, 20, 0.28);

  --accent: #7A2E38;        /* muted wine: links, small emphasis, active states */
  --accent-deep: #5E2129;

  --dark: #161513;
  --on-dark: #F4F2EE;
  --on-dark-muted: rgba(244, 242, 238, 0.62);
  --line-dark: rgba(244, 242, 238, 0.14);

  /* ---- Type ---- */
  --font-display: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --fs-mega: clamp(3.6rem, 1rem + 11vw, 12.5rem);
  --fs-hero: clamp(2.5rem, 1.1rem + 4.1vw, 5.1rem);
  --fs-d1: clamp(2.2rem, 1.2rem + 3.1vw, 4.2rem);
  --fs-d2: clamp(1.75rem, 1.2rem + 1.7vw, 2.75rem);
  --fs-d3: clamp(1.25rem, 1.08rem + 0.55vw, 1.55rem);
  --fs-lg: clamp(1.08rem, 1rem + 0.3vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  /* ---- Layout ---- */
  --container: 1360px;
  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 72px;
  --section-y: clamp(96px, 12vw, 184px);
  --radius: 4px;
  --radius-l: 6px;

  /* ---- Motion: slow, smooth, never bouncy ---- */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --t: 300ms;
  --t-slow: 1100ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
:where(ul[role="list"], ol[role="list"], .list-reset) { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--ink); color: var(--paper); }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus, var(--accent));
  outline-offset: 4px;
  border-radius: 2px;
}
.on-dark { --focus: var(--on-dark); }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-sm);
  transform: translateY(-160%);
  transition: transform var(--t) var(--ease);
}
.skip-link:focus-visible { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4,
.display {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4, .on-dark .display { color: var(--on-dark); }

.t-mega { font-size: var(--fs-mega); line-height: 0.9; letter-spacing: -0.055em; font-weight: 300; }
.t-d1 { font-size: var(--fs-d1); line-height: 1.02; }
.t-d2 { font-size: var(--fs-d2); line-height: 1.08; letter-spacing: -0.03em; }
.t-d3 { font-size: var(--fs-d3); line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; }

.lede {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}
.on-dark .lede { color: var(--on-dark-muted); }

p { text-wrap: pretty; }

/* Small refined label: sentence case, not a terminal readout */
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.kicker--plain::before { display: none; }
.on-dark .kicker { color: var(--on-dark-muted); }

/* Mono — only for indices / technical project metadata */
.meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.on-dark .meta { color: var(--on-dark-muted); }

.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* Inline text link */
.text-link {
  color: var(--ink);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 1px;
  transition: color var(--t) var(--ease), background-size 600ms var(--ease-out);
}
.text-link:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * 0.55); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

.on-dark {
  background: var(--dark);
  color: var(--on-dark-muted);
}

/* Page shell: quiet fade on load / leave */
main { display: block; }
@media (prefers-reduced-motion: no-preference) {
  main { animation: page-in 900ms var(--ease-out) both; }
  body.is-leaving main {
    opacity: 0;
    transition: opacity 280ms var(--ease);
  }
}
@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
