/* ===== Tokens ===== */
:root {
  --ink: #14171F;
  --ink-soft: #1C2030;
  --paper: #F2EDE4;
  --paper-dim: #E8E1D3;
  --amber: #D97B3F;
  --amber-soft: #F0B98C;
  --slate: #8B92A3;
  --slate-dark: #5C6275;
  --line: rgba(255,255,255,0.08);
  --line-paper: rgba(20,23,31,0.1);

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

  --max-w: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--amber); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  background: rgba(20,23,31,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-dot { color: var(--amber); }

.filetabs {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--slate);
}
.filetabs a { transition: color 0.2s; }
.filetabs a:hover { color: var(--amber-soft); }

.resume-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 4px;
  color: var(--paper);
  transition: border-color 0.2s, background 0.2s;
}
.resume-btn:hover { border-color: var(--amber); background: rgba(217,123,63,0.08); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--paper); margin: 5px 0; }

@media (max-width: 760px) {
  .topbar { padding: 18px 20px; flex-wrap: wrap; }
  .resume-btn { display: none; }
  .nav-toggle { display: block; }
  .filetabs {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 14px;
    padding-top: 18px;
    margin-top: 14px;
    border-top: 1px solid var(--line);
  }
  .filetabs.open { display: flex; }
}

/* ===== Hero ===== */
.hero {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  position: relative;
}

.hero-inner { max-width: var(--max-w); margin: 0 auto; width: 100%; }

.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

.hero-line {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.4rem, 3.4vw, 2.5rem);
  line-height: 1.35;
  margin: 0 0 28px;
  color: var(--paper);
  min-height: 1.4em;
}

.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--amber);
  vertical-align: -0.15em;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  font-size: 1.08rem;
  color: var(--slate);
  max-width: 560px;
  margin: 0 0 36px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(217,123,63,0.3); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-soft); }

.hero-meta {
  position: absolute;
  bottom: 36px;
  right: 48px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate-dark);
  display: flex;
  gap: 10px;
}
@media (max-width: 760px) {
  .hero { padding: 0 20px; min-height: 80vh; }
  .hero-meta { display: none; }
}

/* ===== Sections ===== */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 110px 48px;
}
@media (max-width: 760px) {
  .section { padding: 70px 20px; }
}

.section-head { margin-bottom: 48px; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--amber);
  border: 1px solid rgba(217,123,63,0.35);
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

.about-text p {
  color: var(--slate);
  font-size: 1.04rem;
  margin: 0 0 20px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--ink-soft);
}
.about-card-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.about-card-row:last-child { border-bottom: none; padding-bottom: 0; }
.about-card-row span:first-child { color: var(--slate-dark); }
.about-card-row span:last-child { color: var(--amber-soft); }

/* ===== Experience ===== */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-item {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.exp-item:first-child { border-top: none; padding-top: 0; }

.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.exp-head h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0;
}
.exp-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--amber-soft);
  white-space: nowrap;
}
.exp-company {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--slate-dark);
  margin: 0 0 14px;
}
.exp-desc {
  color: var(--slate);
  font-size: 0.98rem;
  margin: 0;
  max-width: 760px;
}

/* ===== Work / Projects ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 760px) { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink-soft);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: rgba(217,123,63,0.4); transform: translateY(-3px); }

.project-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-red { background: #E5736B; }
.dot-amber { background: #E5B96B; }
.dot-green { background: #7FC29B; }
.project-filename {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate-dark);
}

.project-card-body { padding: 22px 20px; flex: 1; }
.project-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 10px;
  font-weight: 500;
}
.project-card-body p {
  color: var(--slate);
  font-size: 0.95rem;
  margin: 0 0 18px;
}

.stack-list {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--amber-soft);
}
.stack-list li {
  border: 1px solid rgba(217,123,63,0.3);
  padding: 3px 8px;
  border-radius: 3px;
}

.project-card-foot {
  display: flex;
  gap: 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.project-card-foot a { color: var(--slate); transition: color 0.2s; }
.project-card-foot a:hover { color: var(--amber-soft); }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;
}
@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-group h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--slate-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 0.9rem;
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--paper);
  transition: border-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--amber); color: var(--amber-soft); }

/* ===== Contact ===== */
.section-contact { padding-bottom: 90px; }

.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; gap: 32px; } }

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form label { display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; color: var(--slate); }
.contact-form input,
.contact-form textarea {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px 14px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.96rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--amber); }
.contact-form button { align-self: flex-start; border: none; cursor: pointer; }

.form-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--amber-soft);
  min-height: 1.2em;
  margin: 0;
}

.contact-links { display: flex; flex-direction: column; gap: 14px; }
.contact-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.contact-link:hover { border-color: var(--amber); transform: translateX(4px); }
.contact-link span { font-family: var(--font-mono); font-size: 0.78rem; color: var(--slate-dark); }
.contact-link strong { font-size: 1rem; font-weight: 500; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 48px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--slate-dark);
}
@media (max-width: 760px) {
  .footer { padding: 22px 20px; flex-direction: column; gap: 6px; }
}
