/* =============================================================================
   DESIGN TOKENS
   ========================================================================= */
:root {
  --bg: #000000;
  --surface: #16141099;
  --surface-2: #17211D;
  --ink: #EDEFEA;
  --muted: #8FA39B;
  --signal: #ff713d;
  --signal-dim: rgba(255, 138, 61, 0.15);
  --phosphor: #6e3500;
  --phosphor-dim: rgba(111, 203, 159, 0.15);
  --danger: #ffab6b;
  --border: rgba(143, 163, 155, 0.18);

  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1120px;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
code { font-family: var(--font-mono); font-size: 0.9em; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--signal); color: #10130f; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================================
   SCROLL PROGRESS
   ========================================================================= */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0%;
  background: linear-gradient(90deg, var(--signal), var(--phosphor));
  z-index: 1001;
  transition: width 0.1s linear;
}

/* =============================================================================
   HEADER / NAV
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(11, 18, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--container); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.logo-dot { color: var(--signal); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 0.92rem; color: var(--muted); position: relative; padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--signal); border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.lang-toggle { padding: 0.5rem 1rem; }

.nav-clock {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.85rem;
}
.nav-clock-label { color: var(--muted); }
.nav-clock-value { color: var(--ink); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--phosphor);
  background: var(--phosphor-dim); border: 1px solid rgba(111,203,159,0.3);
  padding: 6px 12px; border-radius: 999px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--phosphor);
  box-shadow: 0 0 0 0 rgba(111,203,159,0.6);
  animation: pulse-ring 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(111,203,159,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(111,203,159,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,203,159,0); }
}

.nav-toggle {
  display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  display: none; flex-direction: column; padding: 8px 24px 20px; border-top: 1px solid var(--border);
}
.mobile-menu a { padding: 12px 0; color: var(--muted); font-size: 0.98rem; border-bottom: 1px solid var(--border); }
.mobile-menu a:last-child { border-bottom: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu:not([hidden]) { display: flex; }
}
@media (max-width: 560px) {
  .nav-clock-label { display: none; }
}
@media (max-width: 460px) {
  .nav-clock { display: none; }
}

/* =============================================================================
   LAYOUT HELPERS
   ========================================================================= */
.section { padding: 100px 24px; }
.section-alt { background: var(--surface); }
.section-inner { max-width: var(--container); margin: 0 auto; }
.section-eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--signal);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 12px;
}
.section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 28px; max-width: 46ch; }
.section-lead { color: var(--muted); margin: -12px 0 32px; }

@media (max-width: 600px) {
  .section { padding: 64px 20px; }
}

[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Staggered entrance for list-like content once the parent section reveals */
.chip-list li,
.pill-list li,
.about-stats > div,
.timeline > li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-reveal].is-visible .chip-list li,
[data-reveal].is-visible .pill-list li,
[data-reveal].is-visible .about-stats > div,
[data-reveal].is-visible .timeline > li {
  opacity: 1;
  transform: translateY(0);
}
.chip-list li:nth-child(1), .pill-list li:nth-child(1), .about-stats > div:nth-child(1), .timeline > li:nth-child(1) { transition-delay: 60ms; }
.chip-list li:nth-child(2), .pill-list li:nth-child(2), .about-stats > div:nth-child(2), .timeline > li:nth-child(2) { transition-delay: 120ms; }
.chip-list li:nth-child(3), .pill-list li:nth-child(3), .about-stats > div:nth-child(3), .timeline > li:nth-child(3) { transition-delay: 180ms; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--signal); color: #1a1006; }
.btn-primary:hover { transform: translateY(-2px); background: #ff9a54; box-shadow: 0 12px 24px -12px rgba(255,138,61,0.5); }
.btn-ghost { border-color: var(--border); color: white; background: var(--bg); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); }
.btn-block { width: 100%; }

/* =============================================================================
   HERO ACTIONS (CTA + social)
   ========================================================================= */
.hero-actions { display: flex; align-items: center; gap: 14px; margin: 8px 0 32px; flex-wrap: wrap; }
.hero-social { display: flex; gap: 12px; }
.hero-social a {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hero-social a:hover { color: var(--signal); border-color: var(--signal); transform: translateY(-2px); }
.hero-social svg { width: 17px; height: 17px; fill: currentColor; }

/* =============================================================================
   HERO PHOTO
   ========================================================================= */


.hero-photo{
    display:flex;
    justify-content:center;
    align-items:flex-end;
    position:relative;
    mask-image: linear-gradient(to top, transparent 0%, black 60%); 
}

.hero-photo img{
    width:auto;
    height:70svh;
    display:block;
    /* object-fit:contain; */
}


/* =============================================================================
   ABOUT
   ========================================================================= */
.about-grid { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 120px; align-items: start; }
.about-content p { color: var(--muted); margin-bottom: 16px; max-width: 62ch; }
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 28px; }
.chip-list li {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink);
  border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px;
}
.chip-list li:hover { border-color: var(--signal); transform: translateY(-2px); }
.about-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 20px; }
.about-stats dt { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.about-stats dd { margin: 0; font-weight: 600; font-size: 0.95rem; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { position: absolute; inset: 0; min-height: unset; justify-content : center; align-items: flex-end; z-index: 0; }
  .hero-photo img { width: auto; height: 70svh; max-width: none; opacity: 20%;}
  .about-content { position: relative; z-index: 1; }
}

/* =============================================================================
   SKILLS
   ========================================================================= */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 28px; }
.skill-path { font-family: var(--font-mono); color: var(--signal); font-size: 0.85rem; margin-bottom: 14px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list li {
  background: var(--surface); border: 1px solid var(--border); padding: 7px 13px; border-radius: 8px;
  font-size: 0.85rem;
}
.pill-list li:hover { border-color: var(--phosphor); transform: translateY(-2px); }

/* =============================================================================
   PROJECTS
   ========================================================================= */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  transition: opacity 0.5s ease, transform 0.35s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card--entering { opacity: 0; transform: translateY(16px); }
.project-card:hover { transform: translateY(-4px); border-color: var(--signal); box-shadow: 0 20px 40px -24px rgba(0,0,0,0.55); }
.project-card.is-featured { border-color: rgba(255, 126, 61, 0.4); }
.project-period { font-family: var(--font-mono); font-size: 0.72rem; color: var(--phosphor); text-transform: uppercase; letter-spacing: 0.06em; }
.project-card h3 { font-size: 1.1rem; }
.project-card p { color: var(--muted); font-size: 0.92rem; flex-grow: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tags li { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.project-links { display: flex; gap: 16px; margin-top: 4px; }
.project-links a { font-size: 0.85rem; color: var(--signal); border-bottom: 1px solid transparent; }
.project-links a:hover { border-color: var(--signal); }

.project-skeleton { min-height: 220px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.project-error { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 40px 0; }

/* =============================================================================
   TIMELINE
   ========================================================================= */
.timeline { position: relative; padding-left: 32px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 40px; }
.timeline li { position: relative; }
.timeline li::before {
  content: ''; position: absolute; left: -37.5px; top: 4px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--signal);
}
.timeline-year { font-family: var(--font-mono); font-size: 0.78rem; color: var(--signal); display: block; margin-bottom: 6px; }
.timeline h3 { font-size: 1.05rem; margin-bottom: 8px; }
.timeline p { color: var(--muted); max-width: 62ch; }

/* =============================================================================
   CONTACT
   ========================================================================= */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; }
.contact-info p { color: var(--muted); margin: 18px 0 28px; max-width: 48ch; }
.contact-list { display: flex; flex-direction: column; gap: 16px; }
.contact-list li { display: flex; align-items: center; gap: 12px; }
.contact-list svg { width: 18px; height: 18px; fill: var(--muted); flex-shrink: 0; }
.contact-list a { font-size: 0.95rem; }
.contact-list a:hover { color: var(--signal); }

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-size: 0.85rem; color: var(--muted); }
.form-row input, .form-row textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--ink); font-family: var(--font-body); font-size: 0.95rem; resize: vertical;
  transition: border-color 0.2s ease;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--signal); outline: none; }
.form-row.has-error input, .form-row.has-error textarea { border-color: var(--danger); }
.field-error { font-size: 0.78rem; color: var(--danger); min-height: 1em; }

/* Honeypot: visually hidden but still reachable/fillable by simple bots that ignore [hidden] */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; }

.btn-spinner {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(26,16,6,0.3);
  border-top-color: #1a1006; display: none; animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-label { opacity: 0.6; }
.btn.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status { font-size: 0.88rem; min-height: 1.2em; }
.form-status.success { color: var(--phosphor); }
.form-status.error { color: var(--danger); }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   FOOTER
   ========================================================================= */
.site-footer { border-top: 1px solid var(--border); padding: 32px 24px; }
.footer-inner {
  max-width: var(--container); margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem;
}
.visit-counter { font-family: var(--font-mono); }
.back-to-top {
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.back-to-top:hover { border-color: var(--signal); transform: translateY(-2px); }

/* =============================================================================
   TOAST
   ========================================================================= */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(150%);
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  padding: 14px 22px; border-radius: var(--radius-sm); font-size: 0.9rem; z-index: 1200;
  transition: transform 0.3s ease; box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }
.toast.is-error { border-color: var(--danger); }
.toast.is-success { border-color: var(--phosphor); }