*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* light mode */
  --bg: #f6f7f5;
  --surface: #ffffff;
  --panel: #eef0ed;
  --ink: #14181a;
  --ink-2: #3d4548;
  --ink-3: #6b7478;
  --ink-4: #9aa3a6;
  --accent: #2f7d64;       /* sage teal */
  --accent-soft: #e3f0ec;
  --accent-2: #c9862f;     /* amber */
  --accent-2-soft: #f7ecdb;
  --border: #dfe3e0;
  --border-strong: #c9cfcb;
  --red: #d1574a;
  --yellow: #d1a13a;
  --green: #4a9b6e;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
  --display: 'Space Grotesk', sans-serif;
  --radius: 14px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #0d1012;
  --surface: #14181b;
  --panel: #171c1f;
  --ink: #eef1ef;
  --ink-2: #c3cac6;
  --ink-3: #8b9591;
  --ink-4: #5c6663;
  --accent: #4fb98f;
  --accent-soft: rgba(79,185,143,0.1);
  --accent-2: #e0a458;
  --accent-2-soft: rgba(224,164,88,0.1);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --red: #e2685b;
  --yellow: #e0b658;
  --green: #5fc48f;
  color-scheme: dark;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; }
button { font-family: inherit; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(246,247,245,0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  transition: background var(--transition), border-color var(--transition);
}
:root[data-theme="dark"] nav { background: rgba(13,16,18,0.85); }

.nav-container {
  max-width: 1160px;
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }

.nav-links { display: flex; gap: 2.2rem; list-style: none; }
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--ink); }

.theme-toggle {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  width: 38px; height: 38px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--accent-soft); }

/* ── CONSOLE CHROME (signature element) ── */
.console-bar, .card-bar, .modal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.console-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.console-dot.red { background: var(--red); }
.console-dot.yellow { background: var(--yellow); }
.console-dot.green { background: var(--green); }
.console-path {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
.card-status {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 110px 2rem 60px;
  max-width: 1160px;
  margin: 0 auto;
}

.hero-inner { display: flex; flex-direction: column; gap: 3rem; }

.hero-console {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.15);
  max-width: 760px;
}

.console-body { padding: 2rem 2.2rem 2.2rem; }

.console-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}
.console-line:first-child { margin-top: 0; }
.prompt { color: var(--accent); margin-right: 6px; }

.hero-name {
  font-family: var(--display);
  font-size: clamp(34px, 5.5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.hero-photo {
  width: 150px;
  height: 150px;
  margin-left: 100px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

.hero-role {
  font-family: var(--display);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 500;
  color: var(--accent-2);
}

.hero-desc {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 520px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

.btn {
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 9px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.btn-primary { background: var(--ink); color: var(--bg); }
:root[data-theme="dark"] .btn-primary { background: var(--accent); color: #0b1210; }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { color: #0b1210; filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent-soft); }

.arrow { transition: transform var(--transition); display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.hero-stats {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── TICKER ── */
.ticker-wrap {
  background: var(--ink);
  padding: 13px 0;
  overflow: hidden;
}
:root[data-theme="dark"] .ticker-wrap { background: var(--panel); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker 26s linear infinite;
}
.ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
:root[data-theme="dark"] .ticker-item { color: var(--ink-3); }
.ticker-item .dot {
  width: 4px; height: 4px;
  background: var(--accent-2);
  border-radius: 50%;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── SECTIONS ── */
.section {
  padding: 100px 2rem;
  max-width: 1160px;
  margin: 0 auto;
}

.section-head { margin-bottom: 3rem; max-width: 620px; }

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.section-subtitle {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.75;
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: start;
}

.about-text p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.85;
  margin-bottom: 1.1rem;
}

.about-details {
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}
.detail-item:last-child { border: none; padding-bottom: 0; }
.detail-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.detail-value { font-size: 14px; color: var(--ink); }

.skills-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
}
.panel-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.4rem;
}

.skills-grid { display: flex; flex-direction: column; gap: 1.3rem; }
.skill-item { display: flex; flex-direction: column; gap: 8px; }
.skill-name {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
}
.skill-pct { font-family: var(--mono); color: var(--ink-4); font-size: 12px; }

.progress-bar {
  height: 6px;
  background: var(--panel);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px;
  animation: fillbar 1.4s cubic-bezier(0.4,0,0.2,1) forwards;
  animation-play-state: paused;
}
.skills-panel.in-view .progress-fill { animation-play-state: running; }
@keyframes fillbar { to { width: var(--pct); } }

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.2);
}

.project-body { padding: 1.6rem; }
.project-icon { font-size: 30px; display: block; margin-bottom: 0.9rem; }

.project-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.55rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.4rem;
}
.project-stack span {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--panel);
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  transition: gap var(--transition);
}
.project-link:hover { gap: 8px; }
.project-link.ghost { color: var(--ink-4); }
.project-link.ghost:hover { color: var(--ink-2); gap: 4px; }

/* ── PROCESS ── */
.process-section { background: var(--panel); max-width: none; }
.process-section .section-head,
.process-section .process-steps { max-width: 1160px; margin-left: auto; margin-right: auto; }

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1.5rem;
}
.process-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform var(--transition), border-color var(--transition);
}
.process-step:hover { transform: translateY(-4px); border-color: var(--accent-2); }

.step-number {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
}
.step-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.step-description {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.75;
}

/* ── CONTACT ── */
.contact-section {
  background: var(--ink);
  padding: 100px 0;
}
:root[data-theme="dark"] .contact-section { background: var(--surface); border-top: 1px solid var(--border); }

.contact-inner { max-width: 1160px; margin: 0 auto; padding: 0 2rem; }

.contact-label { color: var(--accent-2); }
.contact-title { color: var(--bg); }
:root[data-theme="dark"] .contact-title { color: var(--ink); }

.contact-sub {
  font-size: 15px;
  color: rgba(246,247,245,0.6);
  max-width: 460px;
  line-height: 1.75;
}
:root[data-theme="dark"] .contact-sub { color: var(--ink-3); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-info { display: flex; flex-direction: column; gap: 1rem; }

.contact-link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
:root[data-theme="dark"] .contact-link-item { background: var(--panel); border-color: var(--border); }
.contact-link-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
:root[data-theme="dark"] .contact-link-item:hover { border-color: var(--accent); }

.contact-link-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.08);
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 16px;
}
:root[data-theme="dark"] .contact-link-icon { background: var(--surface); }

.contact-link-text { display: flex; flex-direction: column; gap: 2px; }
.contact-link-type {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
:root[data-theme="dark"] .contact-link-type { color: var(--ink-4); }
.contact-link-val { font-size: 13.5px; color: rgba(255,255,255,0.85); }
:root[data-theme="dark"] .contact-link-val { color: var(--ink-2); }

.social-block { margin-top: 1.4rem; }
.social-label {
  font-size: 12.5px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.8rem;
}
:root[data-theme="dark"] .social-label { color: var(--ink-4); }

.social-links { display: flex; gap: 10px; }
.social-link {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
:root[data-theme="dark"] .social-link { background: var(--panel); border-color: var(--border); }
.social-link:hover { transform: translateY(-2px); border-color: var(--accent-2); background: rgba(255,255,255,0.09); }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
:root[data-theme="dark"] .form-label { color: var(--ink-4); }

.form-input, .form-textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 12px 15px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--bg);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
:root[data-theme="dark"] .form-input, :root[data-theme="dark"] .form-textarea {
  background: var(--panel); color: var(--ink); border-color: var(--border);
}
.form-input::placeholder, .form-textarea::placeholder { color: rgba(255,255,255,0.25); }
:root[data-theme="dark"] .form-input::placeholder, :root[data-theme="dark"] .form-textarea::placeholder { color: var(--ink-4); }
.form-input:focus, .form-textarea:focus { border-color: var(--accent); background: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .form-input:focus, :root[data-theme="dark"] .form-textarea:focus { background: var(--surface); }
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

.btn-send {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 26px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition), filter var(--transition);
}
.btn-send:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-send:hover .arrow { transform: translateX(3px); }

/* ── FOOTER ── */
footer {
  background: var(--ink);
  padding: 1.8rem 2rem;
  text-align: center;
}
:root[data-theme="dark"] footer { background: var(--surface); border-top: 1px solid var(--border); }
footer p {
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255,255,255,0.3);
}
:root[data-theme="dark"] footer p { color: var(--ink-4); }
footer span { color: rgba(255,255,255,0.5); }
:root[data-theme="dark"] footer span { color: var(--ink-3); }

/* ── MODAL ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,12,13,0.6);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal.show { display: flex; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-bar { padding: 10px 14px; }

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-4);
  cursor: pointer;
  z-index: 2;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--ink); }

.modal-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  padding: 1.6rem 1.8rem 0.6rem;
  letter-spacing: -0.02em;
}
.modal-description {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.75;
  padding: 0 1.8rem;
  margin-bottom: 1.4rem;
}

.modal-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 1.8rem;
  margin-bottom: 1.2rem;
}
.modal-detail-item { display: flex; flex-direction: column; gap: 3px; }

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 1.8rem;
  margin-bottom: 1.6rem;
}
.modal-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 5px;
}

.modal-actions {
  display: flex;
  gap: 0.8rem;
  padding: 0 1.8rem 1.8rem;
}

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.reveal.show { opacity: 1; transform: translateY(0); }

/* ── MOBILE ── */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 90px 1.25rem 48px; }
  .section, .contact-inner, .process-section .section-head, .process-section .process-steps { padding-left: 1.25rem; padding-right: 1.25rem; }
  .section { padding-top: 70px; padding-bottom: 70px; }
  .process-section { padding: 70px 0; }
  .hero-stats { gap: 1.8rem; }
  .modal-details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .process-steps { grid-template-columns: 1fr; }
  .console-body { padding: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation-duration: 60s; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .progress-fill { animation: none; width: var(--pct); }
}