/* Portfolio theme: light, airy, azure accents (Clash Display + Satoshi).
   App landing pages (stanza, suvadi) keep style.css + apps.css instead. */

:root {
  --font-display: "Clash Display", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ink-strong: #0f172a;
  --ink-body: #1e293b;
  --ink-soft: #475569;
  --ink-muted: #5b6a80;
  --ink-faint: #94a3b8;
  --hairline: #e6ebf2;
  --hairline-strong: #dbe3ee;
  --surface: #ffffff;
  --surface-raise: #f8fafc;
  --surface-sunken: #f1f5f9;

  --azure: #007aff;
  --azure-lift: #4da3ff;
  --azure-deep: #0062d6;
  --indigo: #3b4ee0;
  --ice: #a9c9ff;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --nav-h: 52px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 32px);
}

body {
  background: var(--surface);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding: calc(var(--nav-h) + 56px) 0 0;
}

body.has-hero {
  padding-top: 0;
}

::selection {
  background: rgba(0, 122, 255, 0.16);
}

.wrap {
  width: calc(100% - 32px);
  max-width: 640px;
  margin: 0 auto;
}

p {
  margin-bottom: 22px;
}

a {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-color: rgba(0, 122, 255, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

a:hover {
  color: var(--azure);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 6px;
}

strong {
  color: var(--ink-strong);
  font-weight: 500;
}

/* ---------- Floating glass nav ---------- */

.topnav {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.topnav-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 768px;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 8px 0 16px;
  border: 4px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.25), 0 0 14px rgba(0, 170, 255, 0.35);
}

.topnav .links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topnav .links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}

.topnav .links a:hover,
.topnav .links a[aria-current="page"] {
  color: #fff;
}

.topnav .links a.nav-cta {
  color: #fff;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
}

@media (max-width: 520px) {
  .topnav .links a.nav-cta {
    padding: 4px 12px;
  }
}

@media (max-width: 520px) {
  .topnav-inner {
    gap: 12px;
    padding: 0 6px 0 10px;
  }

  .topnav .links {
    gap: 14px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topnav .links a {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .topnav-inner {
    gap: 8px;
  }

  .topnav .links {
    gap: 10px;
  }

  .topnav .links a.nav-cta {
    padding: 4px 10px;
  }
}

/* ---------- Buttons ---------- */

.btn-primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0a6fe0 0%, var(--azure-deep) 45%, #2f52e8 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22), 0 8px 24px rgba(0, 82, 204, 0.32);
  transition: box-shadow 0.32s var(--ease), transform 0.32s var(--ease);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28), 0 0 34px rgba(0, 122, 255, 0.42), 0 12px 32px rgba(0, 60, 160, 0.4);
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  padding: 14px 16px;
}

.btn-ghost .ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 0.2s var(--ease);
}

.btn-ghost:hover {
  color: var(--ink-strong);
}

.btn-ghost:hover .ring {
  border-color: var(--azure-lift);
}

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

.hero {
  padding: clamp(1rem, 2vw, 2rem);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.hero-frame {
  position: relative;
  overflow: hidden;
  border-radius: clamp(20px, 2.4vw, 32px);
  min-height: min(calc(100svh - 2rem), 52rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(8.5rem, 14vw, 11rem) 0 clamp(4rem, 8vw, 7rem);
  /* CSS-only "sky": soft azure light, haze near the horizon */
  background:
    radial-gradient(60% 50% at 18% 88%, rgba(169, 201, 255, 0.85) 0%, transparent 70%),
    radial-gradient(55% 45% at 85% 80%, rgba(77, 163, 255, 0.55) 0%, transparent 72%),
    radial-gradient(40% 35% at 70% 18%, rgba(255, 255, 255, 0.9) 0%, transparent 70%),
    linear-gradient(180deg, #e8f1ff 0%, #cfe2ff 38%, #9fc6ff 72%, #6aa7ff 100%);
}

.hero-veil,
.hero-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-veil {
  background:
    radial-gradient(88% 76% at 50% 34%, #fff 0%, rgba(255, 255, 255, 0.93) 26%, rgba(255, 255, 255, 0.74) 48%, rgba(255, 255, 255, 0.4) 70%, rgba(255, 255, 255, 0.12) 88%, transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.14) 20%, transparent 34%),
    linear-gradient(180deg, transparent 72%, rgba(255, 255, 255, 0.4) 91%, rgba(255, 255, 255, 0.72) 100%);
}

.hero-grain {
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 140px;
  transform: translateX(-50%);
  width: min(680px, 90%);
  height: 360px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.07);
  filter: blur(110px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: calc(100% - 32px);
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: clamp(1.25rem, 2.4vw, 2rem);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: clamp(10.5px, 1.1vw, 12px);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.hero-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--azure);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}

.display-1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 5rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--ink-strong);
  margin-bottom: clamp(1.25rem, 2.2vw, 1.75rem);
  text-wrap: balance;
}

.blue-text {
  background: linear-gradient(105deg, #8fc2ff 0%, var(--azure-lift) 26%, var(--azure) 52%, var(--indigo) 82%, #6b4fe0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  max-width: 40rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 16px;
}

/* ---------- Prose & notes ---------- */

.note h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.045em;
  color: var(--ink-strong);
  margin-bottom: 14px;
}

.note h1 + p {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.note h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink-strong);
  margin: 64px 0 20px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}

.note h2:first-of-type {
  margin-top: 40px;
}

.note h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin: 32px 0 6px;
}

.note h3 a {
  text-decoration: none;
}

.note h3 a:hover {
  color: var(--azure);
}

.note p,
.note li {
  color: var(--ink-body);
}

.note ul,
.note ol {
  margin: 0 0 24px 1.25rem;
}

.note li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.note li::marker {
  color: var(--azure-lift);
}

.note pre {
  background: var(--surface-raise);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.55;
}

.note code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.note p code,
.note li code {
  background: var(--surface-sunken);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1px 5px;
}

.note blockquote {
  margin: 0 0 24px;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--azure-lift);
  color: var(--ink-soft);
}

.note img {
  max-width: 100%;
  border-radius: 14px;
}

.note table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.note th,
.note td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
}

.note-meta {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 13.5px;
}

p.note-meta {
  margin-bottom: 12px;
}

/* Post list: each entry is a soft card */
.note-item {
  display: block;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.note-item:hover {
  border-color: var(--hairline-strong);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.note-item a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 16px;
}

.tag {
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--surface-raise);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ---------- Footer ---------- */

.byline {
  display: block;
  width: calc(100% - 32px);
  max-width: 640px;
  margin: 96px auto 0;
  padding: 24px 0 40px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
