/*
  Personal Site Styles – sky-blue theme, soft motion, and clean typography
*/

:root {
  --bg-1: #eaf6ff;
  --bg-2: #d6ecff;
  --card: #ffffff;
  --ink: #1f2d3d;
  --muted: #5b7083;
  --primary: #1e90ff; /* DodgerBlue */
  --primary-600: #1176d1;
  --accent: #7cd1ff;
  --ring: rgba(30, 144, 255, 0.25);
  --shadow: 0 10px 30px rgba(17, 118, 209, 0.15);
}

/* Base */
* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 10% -20%, var(--bg-2), transparent 60%),
              radial-gradient(1000px 700px at 120% 10%, var(--bg-2), transparent 60%),
              linear-gradient(180deg, var(--bg-1), #f9fbff);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { animation: fadeIn 600ms ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Layout */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(140%) blur(8px);
  background: color-mix(in sRGB, var(--bg-1) 70%, white 30%);
  border-bottom: 1px solid color-mix(in sRGB, var(--primary) 12%, white 88%);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}

/* .brand removed on request */

.nav-links a {
  position: relative;
  margin: 0 0.4rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  padding: 0.25rem 0.1rem;
  border-radius: 4px;
  transition: color 0.25s ease;
}

.nav-links a:hover { color: var(--primary-600); }

/* Animated underline (kept, themed) */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--primary-600); }
.nav-links a.active::after { width: 100%; }

/* Header / Hero */
.site-header {
  background: linear-gradient(180deg, color-mix(in sRGB, var(--accent) 14%, white 86%), transparent);
}

.site-header .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 1rem;
  padding-top: 2.2rem;
  padding-bottom: 1.2rem;
}

.site-title {
  font-size: clamp(1.5rem, 2.6vw + 1rem, 2.3rem);
  margin: 0.25rem 0 0.2rem;
}

.site-subtitle {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

/* Profile photo */
.profile {
  width: clamp(200px, 26vw, 300px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 4px solid #fff;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Cards / Sections */
.content-card {
  background: var(--card);
  border: 1px solid color-mix(in sRGB, var(--primary) 10%, white 90%);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.5vw + 0.4rem, 1.5rem);
}

.stack { display: grid; gap: 1.25rem; }

/* Buttons */
.actions { margin: 1.25rem 0 0; display: inline-flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 18px var(--ring);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.02); }

/* Markdown content styles */
.markdown {
  text-align: left;
}
.markdown h1, .markdown h2, .markdown h3 { line-height: 1.25; }
.markdown h1 { font-size: clamp(1.6rem, 2.2vw + 1rem, 2rem); margin: 0.2rem 0 0.6rem; }
.markdown h2 { font-size: clamp(1.25rem, 1.6vw + 0.9rem, 1.5rem); margin: 1.2rem 0 0.4rem; }
.markdown h3 { font-size: 1.1rem; margin: 0.9rem 0 0.4rem; }
.markdown p { margin: 0.6rem 0; color: var(--ink); }
.markdown a { color: var(--primary-600); text-decoration: underline; text-underline-offset: 2px; }
.markdown ul, .markdown ol { padding-left: 1.3rem; }
.markdown blockquote {
  margin: 1rem 0;
  padding: 0.6rem 0.9rem;
  background: color-mix(in sRGB, var(--accent) 12%, white 88%);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: color-mix(in sRGB, var(--ink) 80%, black 20%);
}
.markdown code, .markdown pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.markdown pre {
  background: #0b2942;
  color: #d8e8ff;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  overflow-x: auto;
}

/* Removed custom heading-based collapsibles; rely on native <details> */

/* Toolbar above markdown */
.tools-bar {
  display: flex; gap: 0.5rem; justify-content: flex-end; margin: 0 0 0.75rem 0;
}
.btn-secondary {
  background: linear-gradient(180deg, color-mix(in sRGB, var(--primary) 8%, white 92%), color-mix(in sRGB, var(--primary) 14%, white 86%));
  color: var(--ink);
  border: 1px solid color-mix(in sRGB, var(--primary) 18%, white 82%);
  box-shadow: none;
}
.btn-secondary:hover { filter: none; transform: translateY(-1px); }

/* Responsive embeds */
.markdown .embed-responsive {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.markdown .embed-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */
footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 1rem 3rem;
}

/* Page-specific: remove subtle header background on inner pages */
body.page-plain .site-header {
  background: transparent;
}

/* Media */
@media (max-width: 900px) {
  /* Tablet and down: ensure some space between CTAs */
  .actions { gap: 0.75rem; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0.7rem 0.85rem; }
  .profile { width: clamp(160px, 42vw, 220px); }
  /* Mobile: stack CTAs with vertical spacing */
  .actions { display: grid; grid-auto-flow: row; justify-items: center; gap: 0.75rem; }
  .actions .btn { width: 100%; max-width: 420px; text-align: center; }
}