/* ============================================================
   piccini.app — homepage stylesheet
   Brand: Calibrating Posteriors dark "blueprint" mode.
   Tokens mirror hermes/finance-dashboard/frontend/tailwind.config.js.

   Layout strategy:
     < 960px : single column (hero, then links)
     ≥ 960px : two columns — hero left rail, links + footer right rail
   ============================================================ */

/* ---- Fonts (self-hosted; sourced from substack/05-assets/fonts) -------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/SpaceGrotesk-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/SpaceGrotesk-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Satoshi-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Satoshi-Medium.ttf') format('truetype');
}

/* ---- Design tokens ---------------------------------------------------- */
:root {
  /* Surfaces */
  --bg:           #0D1B2A;
  --surface:      #142640;
  --surface-2:    #1A2D52;
  --surface-3:    #1E3158;
  --edge:         #1E3158;
  --edge-strong:  #2A3F66;

  /* Text */
  --ink:          #E8E8E8;
  --ink-soft:     #A8B8D9;
  --ink-muted:    #64748B;

  /* Brand */
  --navy:         #1B3A72;
  --navy-light:   #3D5A9C;
  --amber:        #F5A623;

  /* Type stacks */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Satoshi', ui-sans-serif, system-ui, sans-serif;
}

/* ---- Reset + base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  position: relative;
  /* Subtle top-of-page glow — softens the upper edge */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(61, 90, 156, 0.18), transparent 60%),
    var(--bg);
}

/* Optional blueprint grid (activated via /?grid querystring) */
body.bg-grid::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(120, 148, 197, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 148, 197, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}
body > main { position: relative; z-index: 1; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--amber); }
em { font-style: italic; color: var(--ink); }

/* ---- Layout ----------------------------------------------------------- */
.layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 40px;

  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 360px 1fr;
    grid-template-rows: auto auto;
    column-gap: 64px;
    row-gap: 20px;
    padding: 40px 32px 28px;
    align-items: stretch;
  }
  .hero { grid-column: 1; grid-row: 1; }
  .rail { grid-column: 2; grid-row: 1; }
  .foot { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 480px) {
  .layout { padding: 36px 20px 32px; }
}

/* ---- Hero (left rail on desktop, top on mobile) ----------------------- */
.hero {
  text-align: center;
}

@media (min-width: 960px) {
  .hero { text-align: left; }
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--edge-strong);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 4px 24px -8px rgba(0, 0, 0, 0.6);
  margin-bottom: 24px;
}

@media (min-width: 960px) {
  .avatar {
    width: 128px;
    height: 128px;
    margin-bottom: 28px;
  }
}

.name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.16em;
  margin: 0 0 24px;
  color: var(--ink);
}

@media (min-width: 960px) {
  .name { font-size: 30px; margin-bottom: 28px; }
}

.role,
.credits,
.tagline,
.bio {
  margin: 0 auto 14px;
  max-width: 56ch;
  text-wrap: balance;
}

@media (min-width: 960px) {
  .role, .credits, .tagline, .bio {
    margin-left: 0;
    margin-right: 0;
  }
}

.role {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}

.credits {
  font-size: 14.5px;
  color: var(--ink-soft);
}
.credits a {
  color: var(--ink);
  border-bottom: 1px dotted var(--ink-muted);
  padding-bottom: 1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.credits a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.tagline {
  font-size: 16px;
  color: var(--ink);
  margin-top: 20px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.tagline a {
  color: var(--ink);
  border-bottom: 1px solid var(--amber);
  padding-bottom: 1px;
  transition: color 120ms ease;
}
.tagline a:hover { color: var(--amber); }

.bio {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ---- Rail (right column on desktop) ----------------------------------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 960px) {
  /* Anchor links to the bottom of the column — the last button aligns with
     the bottom of the hero's bio line. Asymmetric whitespace lives above,
     not below — feels intentional rather than incidental. */
  .rail { justify-content: flex-end; }
}

/* ---- Link cards ------------------------------------------------------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.links__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px) {
  .links__grid { grid-template-columns: 1fr 1fr; }
}

/* Single-card base style */
.link {
  display: grid;
  grid-template-columns: 24px 1fr 14px;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 200ms ease;

  /* Card depth — matches hermes/finance-dashboard `.card-depth` */
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 1px 2px 0 rgba(0, 0, 0, 0.4),
    0 4px 16px -4px rgba(0, 0, 0, 0.3);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 30%);
}

.link:hover {
  background-color: var(--surface-2);
  border-color: var(--edge-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.link .icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Subtle vertical separator between icon and label (the middle span) */
.link > span:nth-child(2) {
  border-left: 1px solid rgba(168, 184, 217, 0.08);
  padding-left: 12px;
  margin-left: -2px;
}

.link .chev {
  color: var(--ink-muted);
  font-size: 12px;
  justify-self: end;
  transition: color 200ms ease, transform 200ms ease;
}
.link:hover .chev { color: var(--amber); transform: translateX(2px); }

/* Featured button — Calibrating Posteriors, hero CTA */
.link--feature {
  padding: 22px 22px;
  font-size: 16px;
  color: var(--ink);
  border-color: var(--edge-strong);
  background-image:
    linear-gradient(180deg, rgba(245, 166, 35, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 30%);
}
.link--feature .icon { color: var(--amber); }
.link--feature:hover {
  border-color: var(--amber);
  color: var(--ink);
}
.link--feature:hover .icon { color: var(--amber); }
.link--feature strong { font-weight: 500; }

/* ---- Footer ----------------------------------------------------------- */
.foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--edge);
  color: var(--ink-muted);
}

.foot a {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-muted);
  transition: color 140ms ease, background 140ms ease;
}
.foot a:hover { color: var(--ink); background: var(--surface); }

.icon-sm {
  width: 15px;
  height: 15px;
}

.copy {
  font-size: 11.5px;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  margin-left: 6px;
}

/* ---- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .link:hover { transform: none; }
  .link:hover .chev { transform: none; }
}
