/* ============================================================
   pirahansiah.com — macOS Tahoe / "macOS 27" inspired design
   System SF font · frosted glass · vibrancy · rounded corners
   ============================================================ */
:root {
  /* light appearance (macOS light mode) */
  --canvas: #f2f3f7;              /* soft slate wallpaper */
  --glass: rgba(255,255,255,0.55);/* frosted panel */
  --glass-strong: rgba(255,255,255,0.82);
  --ink: #1d1d24;                /* near-black system text */
  --ink-2: #5c5c66;
  --accent: #0a66ff;             /* macOS blue */
  --accent-2: #8338e0;           /* vibrant violet */
  --pink: #ff3b69;
  --teal: #24bfa0;
  --rule: rgba(60,60,80,0.12);
  --shadow-sm: 0 2px 10px rgba(20,20,40,0.06);
  --shadow-lg: 0 18px 48px rgba(20,20,50,0.16);
  --radius: 18px;
  --maxw: 1100px;

  /* macOS system font stack (SF Pro on Apple, modern sans elsewhere) */
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Roboto, system-ui, sans-serif;
  --ui-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 520px at 12% -6%, #ffd9e8 0%, rgba(255,217,232,0) 60%),
    radial-gradient(1000px 500px at 95% -10%, #d5e4ff 0%, rgba(213,228,255,0) 58%),
    radial-gradient(900px 600px at 85% 105%, #d9ffef 0%, rgba(217,255,239,0) 55%),
    var(--canvas);
  background-attachment: fixed;
}
img, video, canvas { max-width: 100%; height: auto; }
.article table { width: 100%; overflow-x: auto; display: block; -webkit-overflow-scrolling: touch; }

/* ---------- top bar (frosted glass) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 28px;
  padding-left: calc(28px + env(safe-area-inset-left));
  padding-right: calc(28px + env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  font-family: var(--ui-display); font-weight: 650; font-size: 19px;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand em { font-style: normal; color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  font-family: var(--ui); font-size: 14px; font-weight: 500; letter-spacing: 0;
  color: var(--ink-2); text-decoration: none; padding: 8px 14px; border-radius: 24px;
  transition: background .18s, color .18s;
}
.nav a:hover { background: rgba(255,255,255,0.6); color: var(--ink); }
.nav a.active { color: var(--accent); background: rgba(10,102,255,0.10); }
.nav-toggle { display: none; }
.nav-icon { line-height: 1; }
.nav-item { white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
main { min-height: 60vh; padding-bottom: 60px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-eyebrow {
  font-family: var(--ui); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--ui-display); font-weight: 700;
  font-size: clamp(42px, 6vw, 72px); line-height: 1.04; letter-spacing: -0.025em;
  margin: 0 0 22px;
}
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-lead {
  font-size: 19px; line-height: 1.65; color: var(--ink-2);
  max-width: 680px; margin: 0 0 32px;
}
.hero-lead strong { color: var(--ink); font-weight: 600; }
.hero-lead a { color: var(--accent); font-weight: 600; }
.hero-lead a:hover { color: var(--pink); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-family: var(--ui); font-size: 13px; font-weight: 500;
  padding: 7px 15px; border: 1px solid var(--rule); border-radius: 24px;
  color: var(--ink-2); background: var(--glass); backdrop-filter: blur(12px);
}
.tag.accent { background: var(--accent); color: #fff; border-color: transparent; }

.hero-grid { display: grid; grid-template-columns: 150px 1fr; gap: 36px; align-items: start; }
.avatar {
  width: 150px; height: 150px; border-radius: 50%;
  object-fit: cover; border: 4px solid #fff;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--rule);
}

/* ---------- stat band (macOS tiles) ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
  gap: 14px; margin: 40px 0;
}
.stat {
  background: var(--glass); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 18px; text-align: center;
}
.stat-num { font-family: var(--ui-display); font-weight: 700; font-size: 40px; line-height: 1; color: var(--ink); }
.stat-label { font-family: var(--ui); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin-top: 8px; }

/* ---------- sections ---------- */
.section { padding: 24px 0 48px; }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 32px; }
.section-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--accent); }
.section-title { font-family: var(--ui-display); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; margin: 0; }
.section-sub { color: var(--ink-2); max-width: 640px; }

/* ---------- cards (vibrant glass tiles) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 18px; }
.card {
  background: var(--glass); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px; text-decoration: none; color: var(--ink);
  transition: transform .2s, box-shadow .25s, border-color .2s;
  display: block;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(10,102,255,0.35); }
.card-kicker { font-family: var(--ui); font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.card h3 { font-family: var(--ui-display); font-weight: 650; font-size: 18px; margin: 0 0 10px; line-height: 1.3; }
.card p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.6; }
.card .arrow { color: var(--accent); font-family: var(--mono); font-size: 16px; margin-top: 12px; display: inline-block; }

/* list rows (for publications) */
.list { display: flex; flex-direction: column; }
.item {
  display: grid; grid-template-columns: 96px 1fr; gap: 22px;
  padding: 24px 6px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink);
  align-items: start;
}
.item:hover .item-title { color: var(--accent); }
.item:last-child { border-bottom: none; }
.item-type { font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); padding-top: 5px; }
.item-title { font-family: var(--ui-display); font-weight: 600; font-size: 19px; line-height: 1.35; transition: color .15s; }
.item-desc { font-size: 14.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }

/* ---------- article body (markdown content) ---------- */
.article {
  max-width: 760px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 34px 44px;
  margin: 16px 0;
}
.article h1 { font-family: var(--ui-display); font-weight: 700; font-size: 38px; line-height: 1.1; letter-spacing: -0.02em; margin: 40px 0 12px; }
.article-meta { font-family: var(--ui); font-size: 13px; color: var(--ink-2); margin-bottom: 28px; }
.article h2 { font-family: var(--ui-display); font-weight: 650; font-size: 26px; margin: 36px 0 14px; letter-spacing: -0.01em; }
.article h3 { font-family: var(--ui-display); font-weight: 650; font-size: 20px; margin: 28px 0 12px; }
.article p { margin: 0 0 16px; overflow-wrap: break-word; word-break: break-word; }
.article a { color: var(--accent); text-decoration: none; font-weight: 500; border-bottom: 1px solid rgba(10,102,255,0.3); text-underline-offset: 3px;
  overflow-wrap: break-word; word-break: break-word; transition: border-color .15s; }
.article a:hover { border-bottom-color: var(--accent); }
.article code { overflow-wrap: break-word; word-break: break-word; }
.article img { max-width: 100%; height: auto; border-radius: 12px; margin: 18px 0; border: 1px solid var(--rule); box-shadow: var(--shadow-sm); }
.article pre {
  background: rgba(29,29,36,0.92); color: #e8e8f0; padding: 18px; border-radius: 12px;
  overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
.article code { font-family: var(--mono); font-size: 0.9em; background: rgba(10,102,255,0.10); padding: 2px 6px; border-radius: 5px; color: var(--accent); }
.article pre code { background: none; padding: 0; white-space: pre; word-break: normal; overflow-wrap: normal; color: inherit; }
.article blockquote { border-left: 3px solid var(--accent); margin: 20px 0; padding: 6px 20px; color: var(--ink-2); font-style: normal; background: rgba(10,102,255,0.05); border-radius: 0 10px 10px 0; }
.article ul, .article ol { padding-left: 24px; margin: 0 0 16px; }
.article li { margin-bottom: 6px; }
.article hr { border: none; height: 1px; background: var(--rule); margin: 32px 0; }

.hub-title { font-family: var(--ui-display); font-weight: 700; font-size: clamp(34px,4vw,52px); letter-spacing: -0.02em; margin: 60px 0 8px; }
.hub-sub { color: var(--ink-2); max-width: 640px; margin: 0 0 20px; font-size: 18px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); margin-top: 40px; }
.gdpr-banner {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  background: var(--glass-strong); backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 16px 18px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5;
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.gdpr-banner.active { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.gdpr-banner button {
  flex-shrink: 0; padding: 9px 20px; font-size: 13.5px; font-weight: 600; border: none;
  border-radius: 24px; background: var(--accent); color: #fff; cursor: pointer;
}
.gdpr-banner button:hover { background: #0652cf; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 28px;
  padding-left: calc(28px + env(safe-area-inset-left));
  padding-right: calc(28px + env(safe-area-inset-right));
  padding-bottom: calc(44px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between;
}
.footer-brand { font-family: var(--ui-display); font-weight: 650; font-size: 18px; color: var(--ink); }
.footer-brand em { font-style: normal; color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { font-family: var(--ui); font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.footer-note { width: 100%; font-family: var(--ui); font-size: 12px; color: var(--ink-2); opacity: 0.8; margin-top: 16px; }

/* ---------- 404 / cta ---------- */
.cta { text-align: center; padding: 80px 20px; }
.cta h2 { font-family: var(--ui-display); font-weight: 700; font-size: 34px; letter-spacing: -0.02em; margin: 0 0 12px; }
.cta p { color: var(--ink-2); max-width: 520px; margin: 0 auto 28px; }
.btn {
  display: inline-block; font-family: var(--ui); font-size: 14px; font-weight: 600; letter-spacing: 0;
  background: var(--accent); color: #fff; text-decoration: none; padding: 12px 26px;
  border-radius: 26px; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { background: #0652cf; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn.ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { background: rgba(255,255,255,0.8); }

/* ---------- contact ---------- */
.contact-list { margin: 40px 0; }
.contact-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.contact-row:last-child { border-bottom: none; }
.contact-k { font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.contact-v { font-size: 18px; }
.contact-v a { color: var(--accent); text-decoration: none; }
.contact-v a:hover { color: var(--pink); }

/* ---------- responsive ---------- */
.nav-toggle { display: none; }
@media (min-width: 901px){
  .nav-toggle { display: none !important; }
}
@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--glass-strong);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--rule);
    padding: 8px calc(18px + env(safe-area-inset-left));
    box-shadow: var(--shadow-lg);
    z-index: 60;
  }
  .nav.open { display: flex; }
  .nav a {
    font-size: 16px; font-weight: 500; padding: 15px 4px; border-bottom: 1px solid var(--rule);
    color: var(--ink); border-radius: 0;
    display: block;
  }
  .nav a:last-child { border-bottom: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;          /* iOS minimum touch target */
    background: var(--glass); border: 1px solid var(--rule); border-radius: 12px;
    font-size: 20px; line-height: 1; color: var(--ink); cursor: pointer;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
}

@media (max-width: 760px) {
  .topbar { position: -webkit-sticky; position: sticky; }
  .topbar-inner { padding: 12px 18px;
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .wrap { padding: 0 18px; }
  .article { padding: 24px 22px; border-radius: 14px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: clamp(34px, 11vw, 46px); }
  .hero-lead { font-size: 17px; }
  .avatar { width: 120px; height: 120px; }
  .item { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .contact-row { grid-template-columns: 1fr; gap: 4px; }
  .section-title { font-size: 24px; }
  .article h1 { font-size: 30px; line-height: 1.15; }
  .article h2 { font-size: 22px; }
  .stat-num { font-size: 32px; }
  .footer-links { gap: 14px; }
  .footer-links a { padding: 8px 0; }   /* taller tap area */
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .brand { font-size: 16px; }
  .nav a { font-size: 15px; }
  .section-title { font-size: 21px; }
  .article h1 { font-size: 26px; }
  .footer-inner { padding: 30px 18px 40px; }
}