/* Minimal portfolio — dark-first, sidebar layout */
:root {
  --bg: #000000;
  --text: #c8c8c8;
  --text-muted: #888888;
  --border: #333333;
  --accent: #e0e0e0;
  /* script for nav + hero; kalam = soft handwritten curves, still easy to read */
  --curly-font: "Dancing Script", "Brush Script MT", cursive;
  --body-font: "Kalam", ui-sans-serif, system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-muted: #555555;
  --border: #d0d0d0;
  --accent: #111111;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[id] {
  scroll-margin-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 400;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-wrap {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  gap: clamp(2rem, 6vw, 5rem);
}

/* Sidebar */
.site-nav {
  flex: 0 0 auto;
  width: min(160px, 28vw);
  border-right: 1px solid var(--border);
  padding-right: clamp(1rem, 3vw, 2rem);
  align-self: flex-start;
  position: sticky;
  top: clamp(1.5rem, 4vw, 3rem);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin-bottom: 0.5rem;
}

.site-nav a {
  font-family: var(--curly-font);
  font-style: normal;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a.active {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Main */
.site-main {
  flex: 1;
  min-width: 0;
  padding-bottom: 4rem;
}

.greeting {
  font-family: var(--curly-font);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
}

.hero {
  margin: 1.5rem auto 2rem;
  max-width: min(640px, 100%);
  text-align: center;
}

.hero img {
  width: 100%;
  max-width: min(640px, 100%);
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

.tagline {
  font-family: var(--curly-font);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.35;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.section-label {
  font-family: var(--curly-font);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.section-label--center {
  text-align: center;
  width: 100%;
}

.content-block {
  margin-bottom: 2.5rem;
}

.content-block p {
  margin: 0 0 1rem;
  max-width: 52ch;
}

.content-block--center {
  text-align: center;
}

.content-block--center p {
  margin-left: auto;
  margin-right: auto;
  max-width: 58ch;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.content-block ul {
  margin: 0;
  padding-left: 1.25rem;
  max-width: 52ch;
}

.content-block li {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.content-block li strong {
  font-family: var(--body-font);
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.35rem;
}

.experience-item {
  margin-bottom: 1.75rem;
}

.experience-item strong a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#contact p {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
  margin-top: 2rem;
  align-items: center;
}

.social-row a {
  font-family: var(--curly-font);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.social-row a:hover {
  color: var(--text);
}

.social-row img {
  width: 20px;
  height: 20px;
  filter: opacity(0.85);
}

[data-theme="light"] .social-row img {
  filter: none;
  opacity: 0.85;
}

.footer-note {
  font-family: var(--curly-font);
  font-weight: 500;
  margin-top: 3rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Subpages */
.page-title {
  font-family: var(--curly-font);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.post-content {
  max-width: 60ch;
}

.post-content h2 {
  font-family: var(--curly-font);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.post-content h3 {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 1.08rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.post-content ul,
.post-content ol {
  text-align: left;
  list-style-position: outside;
  padding-left: 1.25rem;
}

.post-content ol li {
  margin-bottom: 0.35rem;
}

.doc-lead {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95em;
}

/* Copy prank (copy-prank.js) — fake flash + overlay; cannot access real screen or camera */
#copy-prank-flash {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s ease-out;
}

#copy-prank-flash.is-on {
  opacity: 0.92;
}

#copy-prank-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: #000;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease-out;
}

#copy-prank-overlay.is-on {
  opacity: 1;
  pointer-events: auto;
}

.copy-prank-overlay-text {
  font-family: var(--curly-font);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  color: #444;
  margin: 0;
  text-align: center;
  padding: 1rem;
}

#copy-prank-toast {
  position: fixed;
  bottom: max(5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 2147483647;
  max-width: min(90vw, 420px);
  padding: 0.65rem 1rem;
  background: var(--border);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--text-muted);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
  text-align: center;
}

#copy-prank-toast.is-on {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #copy-prank-flash,
  #copy-prank-overlay,
  #copy-prank-toast {
    transition: none;
  }
}

.post-content ul ul {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.post-content li {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.post-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Theme toggle */
.theme-toggle {
  font-family: var(--curly-font);
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  [id] {
    scroll-margin-top: 72px;
  }

  body {
    font-size: 16px;
  }

  .site-wrap {
    flex-direction: column;
    gap: 1.25rem;
    padding-left: max(0.875rem, env(safe-area-inset-left));
    padding-right: max(0.875rem, env(safe-area-inset-right));
  }

  .site-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
    position: static;
  }

  .site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    justify-content: flex-start;
  }

  .site-nav li {
    margin-bottom: 0;
  }

  .site-nav a {
    font-size: 1.1rem;
    padding: 0.45rem 0.2rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }

  .content-block p,
  .content-block ul {
    max-width: 100%;
  }

  .content-block--center p {
    max-width: 100%;
  }

  .post-content {
    max-width: 100%;
  }

  .social-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .social-row a {
    min-height: 44px;
    padding: 0.25rem 0;
  }

  .theme-toggle {
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .greeting {
    font-size: clamp(1.65rem, 9vw, 2.5rem);
  }

  .site-nav a {
    font-size: 1rem;
  }
}
