/* ========================================
   Custom Properties
   ======================================== */
:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-text-secondary: #57534e;
  --color-text-tertiary: #a8a29e;
  --color-primary: #1c1917;
  --color-accent: #78716c;
  --color-border: #e7e5e4;
  --color-border-light: #f5f5f4;
  --nav-h: 56px;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  padding-top: var(--nav-h);
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ========================================
   Navbar
   ======================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250, 250, 249, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.navbar.scrolled {
  border-color: var(--color-border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.05);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.01em;
  transition: opacity 0.2s;
}

.nav-logo:hover { opacity: 0.65; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
  background: var(--color-border-light);
}

.nav-cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  margin-left: 8px;
  transition: all 0.2s var(--ease);
  letter-spacing: 0.02em;
}

.nav-cta:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.25s var(--ease);
  transform-origin: center;
}

.nav-hamburger.open span:first-child {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-hamburger.open span:last-child {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile drawer — fixed below the navbar */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 24px 20px;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.nav-drawer.open { display: flex; }

.drawer-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
  transition: color 0.2s;
}

.drawer-link:last-child { border-bottom: none; }
.drawer-link:hover { color: var(--color-text); }

/* ========================================
   Hero
   ======================================== */
.hero {
  min-height: calc(82vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 60px 0 80px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: center;
  width: 100%;
}

.hero-greeting {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.hero h1 em {
  font-style: italic;
  color: var(--color-accent);
}

.hero-rule {
  width: 40px;
  height: 1px;
  background: var(--color-border);
  margin: 22px 0;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
  font-weight: 400;
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  max-width: 460px;
  line-height: 1.8;
  margin-bottom: 22px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.tag {
  padding: 4px 12px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s var(--ease);
}

.tag:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

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

/* Portrait */
.hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.portrait-frame {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 1px var(--color-border),
    0 8px 30px rgba(0, 0, 0, 0.07);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) 1.2s forwards;
}

.portrait-scroll-hint span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--color-border), transparent);
  animation: scrollPulse 2s ease-in-out 1.5s infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.15); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: #0c0a09;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

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

.btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  transform: translateY(-1px);
}

/* ========================================
   Section shared
   ======================================== */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--color-border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 48px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.section h2,
.section-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ========================================
   Projects
   ======================================== */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--color-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease-out);
}

.project-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
  border-color: #d4d0ce;
}

.project-card:hover::before {
  transform: scaleY(1);
}

.project-card-inner {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0;
}

.project-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 400;
  color: var(--color-border);
  line-height: 1;
  padding: 36px 0 36px 32px;
  align-self: start;
  letter-spacing: -0.04em;
  transition: color 0.3s var(--ease);
  user-select: none;
}

.project-card:hover .project-num {
  color: #d4d0ce;
}

.project-body {
  padding: 32px 36px 32px 16px;
  border-left: 1px solid var(--color-border-light);
}

.project-meta {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.project-tag {
  padding: 2px 9px;
  background: var(--color-bg);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 2px;
}

.project-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 560px;
  margin-bottom: 24px;
}

.project-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.project-btn { font-size: 0.8rem; }

.project-stack {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.project-stack span::before {
  content: '·';
  margin-right: 10px;
  opacity: 0.5;
}

.project-stack span:first-child::before { display: none; }

/* ========================================
   Contact
   ======================================== */
.section-contact { border-top: 1px solid var(--color-border); }

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 10px;
  line-height: 1.75;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: var(--font-sans);
  width: 100%;
  text-align: left;
}

.contact-link:first-child { border-top: 1px solid var(--color-border-light); }

.contact-link svg {
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  transition: color 0.2s;
}

.contact-link svg[fill="currentColor"] { fill: var(--color-text-tertiary); }

.contact-link .link-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.2s var(--ease);
  color: var(--color-text-secondary);
}

.contact-link:hover { color: var(--color-text); }
.contact-link:hover svg { color: var(--color-text); }
.contact-link:hover svg[fill="currentColor"] { fill: var(--color-text); }
.contact-link:hover .link-arrow { opacity: 1; transform: translateX(0); }

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 28px 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.footer p {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

/* ========================================
   Scroll Reveal
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.12s; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero {
    min-height: auto;
    padding: 40px 0 60px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .hero h1 { font-size: 2.2rem; }

  .hero-desc, .hero-rule {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-tags, .hero-actions { justify-content: center; }

  .hero-portrait { order: -1; }

  .portrait-frame { width: 150px; height: 150px; }

  .portrait-scroll-hint { display: none; }

  .section { padding: 56px 0; }

  .section-header {
    flex-direction: column;
    gap: 4px;
    margin-bottom: 32px;
  }

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

  .project-num {
    font-size: 2rem;
    padding: 24px 0 0 24px;
  }

  .project-body { padding: 16px 24px 28px; border-left: none; border-top: 1px solid var(--color-border-light); }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.85rem; }
  .portrait-frame { width: 130px; height: 130px; }
}
