/* ============================================
   Design tokens
   ============================================ */
:root {
  --bg: #ffffff;
  --text: #0d0d0d;
  --text-secondary: #68686c;
  --text-tertiary: #9a9a9e;
  --border: #e7e7e9;
  --surface: #f6f6f7;
  --accent: #7b3fe4;
  --accent-soft: #f1eafc;
  --max-width: 1180px;
  --gutter: 28px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  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(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

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

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

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.site-header nav {
  display: flex;
  gap: 28px;
}

.site-header nav a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

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

.nav-toggle {
  display: none;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 96px 0 72px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 24px;
}

.hero .eyebrow {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 24px;
  max-width: 15ch;
}

.hero .lede {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--text);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ============================================
   Claude Terminal / Window Card
   ============================================ */
.hero-terminal-wrap {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.claude-terminal {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 16px 36px -12px rgba(13, 13, 13, 0.08),
    0 2px 6px rgba(13, 13, 13, 0.03);
  overflow: hidden;
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.claude-terminal:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 42px -12px rgba(13, 13, 13, 0.12),
    0 4px 10px rgba(13, 13, 13, 0.04);
}

/* Header with 3 window control dots */
.terminal-header {
  padding: 16px 20px 10px;
  display: flex;
  align-items: center;
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.terminal-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #ff5f56;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #27c93f;
}

/* Body */
.terminal-body {
  padding: 8px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.terminal-main-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.prompt-sym {
  color: #c8653b;
  font-weight: 700;
  font-size: 20px;
  user-select: none;
  line-height: 1;
}

.prompt-sym.dim {
  color: var(--text-tertiary);
  font-size: 15px;
}

.prompt-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.terminal-sub-role {
  font-size: 15px;
  color: var(--text-secondary);
  padding-left: 20px;
  margin-top: -8px;
  font-weight: 500;
}

.terminal-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #c8653b;
  font-weight: 500;
  margin-top: 2px;
}

.status-asterisk {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.status-text {
  color: #c8653b;
  font-weight: 600;
}

.status-sep {
  color: var(--text-tertiary);
}

.status-loc {
  color: var(--text-secondary);
  font-weight: 400;
}

.terminal-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.terminal-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-row {
  display: flex;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.4;
}

.contact-prompt {
  color: var(--text-tertiary);
  margin-right: 8px;
  font-weight: 600;
  user-select: none;
}

.contact-label {
  color: var(--text-secondary);
  width: 78px;
  flex-shrink: 0;
  font-weight: 500;
}

.contact-val {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
  transition: all 0.15s ease;
  word-break: break-all;
}

.contact-val:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Footer command bar & mascot */
.terminal-footer {
  border-top: 1px solid var(--border);
  padding: 10px 18px 8px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background: #fafafb;
  min-height: 44px;
}

.terminal-cmd-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #c8653b;
  animation: term-cursor 1.1s steps(2, start) infinite;
}

@keyframes term-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.terminal-mascot {
  line-height: 0;
  margin-bottom: -1px;
}

/* ============================================
   Section shell
   ============================================ */
section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-head .section-note {
  font-size: 14px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ============================================
   About
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}

.about-grid .label {
  font-size: 28px;
  color: var(--text-tertiary);
}

.about-copy p {
  max-width: 640px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Projects
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.project-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  border-color: var(--text);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -16px rgba(13, 13, 13, 0.25);
}

.project-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.project-media .link-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-body {
  padding: 20px 22px 22px;
}

.project-body .project-role {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 6px;
}

.project-body h3 {
  font-size: 18px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.project-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tools span {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--surface);
  border-radius: 6px;
  padding: 3px 8px;
}

.project-card-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-card-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.project-card-links a:hover {
  color: var(--text);
}

.project-card-links a.gh-link {
  color: var(--accent);
}

.project-card-links a.gh-link:hover {
  color: #000;
}

/* ============================================
   Timeline lists (achievements, trainings, certificates)
   ============================================ */
.entry-list {
  display: flex;
  flex-direction: column;
}

.entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.entry:first-child {
  border-top: none;
  padding-top: 0;
}

.entry .entry-meta {
  font-size: 14px;
  color: var(--text-tertiary);
}

.entry h3 {
  font-size: 16px;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}

.entry p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 620px;
}

.entry .entry-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 10px;
}

.entry .entry-link:hover {
  text-decoration: underline;
}

/* ============================================
   Footer / contact
   ============================================ */
.contact-panel {
  background: var(--text);
  color: #fff;
  border-radius: 20px;
  padding: 56px 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-panel h2 {
  font-size: 30px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  max-width: 26ch;
}

.contact-panel p {
  color: #b8b8bd;
  margin: 0;
  max-width: 360px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.contact-links a {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.contact-links a:hover {
  color: var(--accent-soft);
}

footer.site-footer {
  padding: 28px 0 60px;
  font-size: 13px;
  color: var(--text-tertiary);
  border-top: none;
}

footer.site-footer .container {
  display: flex;
  justify-content: space-between;
}

/* ============================================
   Project detail pages
   ============================================ */
.detail-hero {
  padding: 48px 0 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.back-link:hover {
  color: var(--text);
}

.detail-hero .project-role {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 10px;
}

.detail-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  max-width: 20ch;
}

.detail-hero .lede {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 0 24px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.detail-meta div span {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.detail-meta div strong {
  font-size: 14px;
  font-weight: 600;
}

.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 48px;
}

.detail-gallery figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.detail-gallery figcaption {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.detail-columns {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding-bottom: 24px;
}

.detail-columns .label {
  font-size: 14px;
  color: var(--text-tertiary);
}

.detail-columns ul {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text-secondary);
  font-size: 15px;
}

.detail-columns li {
  margin-bottom: 10px;
}

.note-banner {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 14px;
  color: #4a2792;
  margin-bottom: 48px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 980px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-terminal-wrap {
    justify-content: flex-start;
  }

  .claude-terminal {
    max-width: 520px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .site-header nav {
    display: none;
  }

  .about-grid,
  .detail-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .contact-panel {
    flex-direction: column;
    align-items: flex-start;
    padding: 40px 28px;
  }

  .contact-links {
    align-items: flex-start;
  }

  footer.site-footer .container {
    flex-direction: column;
    gap: 6px;
  }
}
