/* ==========================================================================
   PARAM NAHATA — DESIGN SYSTEM
   Grounding concept: import/export & customs paperwork — ledgers, manifests,
   approval stamps — reinterpreted as a premium, editorial developer/product site.
   Palette avoids generic "AI portfolio" defaults (no cream+terracotta, no
   neon-on-black, no glow/blob gradients).
   ========================================================================== */

:root {
  /* Color */
  --paper:      #FAF9F6;   /* base background, cool-neutral paper */
  --paper-2:    #F1EFE9;   /* slightly deeper panel background */
  --ink:        #1B1A18;   /* primary text, warm near-black */
  --ink-soft:   #55524C;   /* secondary text */
  --line:       #DEDAD0;   /* hairline borders, ledger rules */
  --accent:     #1F3A5F;   /* stamp-ink navy — links, primary actions */
  --accent-2:   #16283F;   /* darker navy for hover/pressed */
  --seal:       #A63A2E;   /* muted stamp red — signature accent only, used sparingly */
  --paper-dark: #14161A;   /* used only where a page intentionally inverts (rare) */

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;

  /* Layout */
  --container: 1180px;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --paper:      #14161A;
  --paper-2:    #1C1F24;
  --ink:        #F2F0EA;
  --ink-soft:   #A8A49A;
  --line:       #2E3138;
  --accent:     #7FA6D6;
  --accent-2:   #A9C4E6;
  --seal:       #E08B7D;
}
[data-theme="dark"] .btn-primary { color: #0F1114; }
[data-theme="dark"] .btn-primary:hover { color: #0F1114; }
[data-theme="dark"] .site-nav { background: rgba(20, 22, 26, 0.86); }
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select { background: #1C1F24; color: var(--ink); }

body { transition: background 0.3s var(--ease), color 0.3s var(--ease); }

/* ---- Dark theme (manual toggle, or auto via prefers-color-scheme) ----
   Keeps the same stamp-navy/seal-red identity, inverted paper/ink. */
[data-theme="dark"] {
  --paper:      #14161A;
  --paper-2:    #1C1F24;
  --ink:        #F3F1EC;
  --ink-soft:   #A9A69E;
  --line:       #2E3138;
  --accent:     #6E97C4;
  --accent-2:   #8FB2DA;
  --seal:       #E0685A;
}
[data-theme="dark"] .btn-primary { color: #14161A; }
[data-theme="dark"] .site-nav { background: rgba(20, 22, 26, 0.86); }
[data-theme="dark"] .manifest-grid,
[data-theme="dark"] .manifest-item { background: var(--paper); }
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select { background: var(--paper-2); color: var(--ink); }

body { transition: background 0.3s var(--ease), color 0.3s var(--ease); }

.theme-toggle {
  background: none; border: 1px solid var(--line); border-radius: 20px;
  width: 40px; height: 26px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin-left: 20px; color: var(--ink); position: relative; flex-shrink: 0;
}
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
@media (max-width: 1100px) { .theme-toggle { margin-left: auto; margin-right: 12px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-break: break-word;
}
img, video { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1em; color: var(--ink-soft); }
a  { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-block;
  margin-bottom: 0.9em;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 64px 0; } }

/* ---- Ledger divider: thin ruled line, used between sections instead of
   default numbered 01/02/03 markers (content here isn't a strict sequence) ---- */
.ledger-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.4s var(--ease);
}
.site-nav.nav-hidden { transform: translateY(-100%); }
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-links {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0.86rem;
  white-space: nowrap;
}
.nav-links a {
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.nav-toggle { display: none; }

@media (max-width: 1100px) {
  .nav-links {
    position: fixed; inset: 64px 0 0 0;
    background: var(--paper);
    flex-direction: column;
    padding: 32px 24px;
    display: none;
    gap: 20px;
    font-size: 1.1rem;
    white-space: normal;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
}

/* ---- Stamp mark: signature element, reused as logo + hover "approved" state ---- */
.stamp {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.6px solid var(--seal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--seal);
  transform: rotate(-8deg);
  flex-shrink: 0;
}
.stamp-reveal {
  animation: stamp-in 0.6s var(--ease) both;
}
@keyframes stamp-in {
  0%   { opacity: 0; transform: scale(1.8) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(0.92) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-2);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(31, 58, 95, 0.25);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(0) scale(0.98); }

/* ---- Hero ---- */
.hero {
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-accent::before {
  content: '';
  position: absolute;
  top: -180px; right: -160px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(31, 58, 95, 0.10) 0%, rgba(31, 58, 95, 0) 70%);
  pointer-events: none;
}
[data-theme="dark"] .hero-accent::before {
  background: radial-gradient(circle, rgba(127, 166, 214, 0.14) 0%, rgba(127, 166, 214, 0) 70%);
}
.hero-eyebrow { display: flex; align-items: center; gap: 10px; }
.hero h1 { max-width: 820px; position: relative; }
.hero .lede {
  font-size: 1.15rem;
  max-width: 560px;
  margin-top: 20px;
}
.hero-actions { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }

/* Typed word in the hero: colored + underline bar so it doesn't blend into the paragraph */
.typing-text { color: var(--accent); font-weight: 600; }
.typing-text-inner { border-bottom: 2px solid var(--seal); padding-bottom: 1px; }

/* ---- Hero layout: mobile-first. Single column by default (photo capped at
   a sane fixed size and centered); becomes two columns only on wide screens.
   Uses Grid rather than flexbox specifically because flex children refuse to
   shrink below their content's intrinsic size by default — which was exactly
   why the photo ignored its max-width and blew out at in-between viewport
   widths. Grid does not have that failure mode. ---- */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero-photo-wrap {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.hero-photo-card {
  position: relative;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 4/5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transform: rotate(1.2deg);
  box-shadow: 0 24px 48px -24px rgba(27, 26, 24, 0.25);
  background: var(--paper-2);
}
.hero-photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-photo-stamp {
  position: absolute;
  bottom: 14px; right: 14px;
  width: 46px; height: 46px;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(2px);
  font-size: 0.68rem;
}
[data-theme="dark"] .hero-photo-stamp { background: rgba(20, 22, 26, 0.85); }

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.5fr 1fr; gap: 56px; }
  .hero-photo-wrap { order: 0; }
  .hero-photo-card { max-width: 320px; }
}

/* ---- Reveal-on-scroll (applied via JS IntersectionObserver) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Manifest-style grid (project/certificate catalogs) ----
   Deliberately NOT glass/blur cards: hairline borders like ruled ledger rows. */
.manifest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.manifest-item {
  background: var(--paper);
  padding: 28px;
  position: relative;
  transition: background 0.3s var(--ease);
}
.manifest-item:hover { background: var(--paper-2); }
.manifest-item .item-no {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.manifest-item .thumb {
  width: 100%; aspect-ratio: 16/10;
  object-fit: cover;
  border: 1px solid var(--line);
  margin: 14px 0;
  transition: transform 0.5s var(--ease);
}
.manifest-item:hover .thumb { transform: scale(1.015); }
.manifest-item h3 { margin-bottom: 6px; }
.manifest-item .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink-soft);
}
.manifest-item .approved {
  position: absolute; top: 20px; right: 20px;
  opacity: 0; transform: scale(1.3) rotate(-10deg);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.manifest-item:hover .approved { opacity: 1; transform: scale(1) rotate(-10deg); }

/* ---- Product page: deliberately calmer, faster to scan ---- */
.product-hero {
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--line);
}
.product-hero .lede { max-width: 640px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-top: 40px;
}
.feature-grid .feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.faq-item { border-top: 1px solid var(--line); padding: 22px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--ink-soft); }
.faq-item[open] summary::after { content: '–'; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 28px; border-left: 1px solid var(--line); }
.timeline-item { padding-bottom: 40px; position: relative; }
.timeline-item::before {
  content: '';
  position: absolute; left: -33px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
}
.timeline-item .date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); }

/* ---- Forms ---- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { min-height: 140px; resize: vertical; }

/* Visible keyboard focus everywhere (accessibility floor) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  margin-top: 80px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-grid > div { min-width: 0; flex: 1 1 180px; overflow-wrap: break-word; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge-featured {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 20px;
  padding: 2px 9px;
  display: inline-block;
}

/* ---- Theme toggle ---- */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 40px; height: 26px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 0.7rem;
}
.theme-toggle .icon-sun, .theme-toggle .icon-moon { opacity: 0.6; }
@media (max-width: 1100px) { .theme-toggle { margin-top: 8px; } }

/* ---- Footer social links ---- */
.social-links a { margin-right: 14px; }

/* ---- Typing effect ---- */
.typing-text::after {
  content: '';
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: -2px;
  animation: blink-caret 0.9s step-end infinite;
}
@keyframes blink-caret { 50% { opacity: 0; } }

/* ---- Reveal variants ---- */
.reveal.zoom { transform: scale(0.92); }
.reveal.zoom.is-visible { transform: scale(1); }
.reveal.slide-left { transform: translateX(-28px); }
.reveal.slide-left.is-visible { transform: translateX(0); }
.reveal.slide-right { transform: translateX(28px); }
.reveal.slide-right.is-visible { transform: translateX(0); }

/* ---- About / photo section ---- */
.about-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

/* ---- Testimonial cards ---- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.testimonial-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--paper);
}
.testimonial-card .stars { color: var(--seal); font-size: 0.85rem; margin-bottom: 10px; }
.testimonial-card .name { font-weight: 600; margin-top: 12px; }
.testimonial-card .role { font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Skills pills ---- */
.skills-group { margin-bottom: 24px; }
.skills-group h4 { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 10px; }
.skill-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 0 8px 8px 0;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.skill-pill:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ---- Print styles for resume.php ---- */
@media print {
  .site-nav, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  section { padding: 12px 0; }
}

/* ---- Admin panel (kept simple/functional, no editorial styling) ---- */
.admin-body { background: #f4f4f5; font-family: var(--font-body); }
.admin-wrap { max-width: 1040px; margin: 40px auto; padding: 0 20px; }
.admin-card { background: #fff; border: 1px solid #e5e5e7; border-radius: 10px; padding: 28px; margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.admin-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid #e5e5e7; margin-bottom: 24px; }
.admin-nav a { margin-right: 16px; font-size: 0.9rem; }
.status-pill { font-size: 0.72rem; padding: 2px 9px; border-radius: 20px; font-family: var(--font-mono); }
.status-published { background: #e3f5e6; color: #1c7a34; }
.status-draft { background: #f1f1f1; color: #777; }
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #e3f5e6; color: #1c7a34; }
.alert-error { background: #fbe9e7; color: var(--seal); }

/* ---- Typing effect ---- */
.typing-line {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  min-height: 1.4em;
}
.typing-cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Additional reveal variants ---- */
.reveal-zoom { opacity: 0; transform: scale(0.94); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-zoom.is-visible { opacity: 1; transform: scale(1); }
.reveal-left { opacity: 0; transform: translateX(-24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-right.is-visible { opacity: 1; transform: translateX(0); }

/* ---- About / photo section ---- */
.about-section { display: flex; gap: 56px; align-items: center; flex-wrap: wrap; }
.about-photo {
  width: 220px; height: 220px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--line);
  flex-shrink: 0;
  transition: transform 0.5s var(--ease);
}
.about-photo:hover { transform: scale(1.03); }
.about-text { flex: 1 1 420px; }
.skill-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.skill-chip {
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px;
  color: var(--ink-soft); transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.skill-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Feedback / testimonials ---- */


/* ---- Social links (footer) ---- */
.social-links { display: flex; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.social-links a { font-size: 0.85rem; }

/* ---- Resume page ---- */
.resume-doc { max-width: 820px; margin: 0 auto; background: #fff; color: #1B1A18; padding: 56px; border: 1px solid var(--line); }
.resume-doc h1 { font-size: 2rem; margin-bottom: 2px; }
.resume-doc .role { color: #55524C; margin-bottom: 20px; }
.resume-doc h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid #DEDAD0; padding-bottom: 6px; margin-top: 28px; }
.resume-doc .resume-item { margin-bottom: 14px; }
.resume-doc .resume-item .meta { font-family: var(--font-mono); font-size: 0.78rem; color: #777; }
.resume-toolbar { max-width: 820px; margin: 0 auto 20px; display: flex; justify-content: flex-end; gap: 12px; }
@media print {
  .site-nav, .site-footer, .resume-toolbar { display: none !important; }
  .resume-doc { border: none; padding: 0; }
}

/* ---- Admin: extra list styling reused across feedback/messages/newsletter ---- */
.admin-actions a, .admin-actions button { margin-right: 10px; }
