*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #E8E8E8;
  --hover-bg: #F7F7F7;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Language — EN default, toggle adds lang-id to body */
.id { display: none; }
body.lang-id .id { display: inline; }
body.lang-id .en { display: none; }

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-name {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Layout */
.hero,
.section,
footer {
  max-width: 740px;
  margin: 0 auto;
  padding-left: 48px;
  padding-right: 48px;
}

/* Hero */
.hero {
  padding-top: 156px;
  padding-bottom: 100px;
}

.hero-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(46px, 7.5vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 36px;
}

.hero-bottom {
  display: flex;
  align-items: stretch;
  gap: 40px;
}

.hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.hero-intro {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  font-weight: 300;
}

.hero-links {
  display: flex;
  gap: 20px;
}

.hero-links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

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

.email-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.copy-toast {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: var(--bg);
  font-size: 9.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero-photo {
  position: relative;
  flex-shrink: 0;
  width: 128px;
}

.hero-photo img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}

.photo-placeholder {
  width: 128px;
  height: 128px;
  background: #F0F0F0;
  border: 1px dashed #D0D0D0;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.photo-placeholder span {
  font-size: 11px;
  color: #AAAAAA;
  letter-spacing: 0.06em;
}

/* Sections */
.section {
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 44px;
  display: block;
}

/* Projects */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  position: relative;
  border-top: 1px solid var(--border);
  transition: opacity 0.3s ease;
}

.project-list:hover .project-item {
  opacity: 0.4;
}

.project-list:hover .project-item:hover,
.project-list:hover .project-item.active {
  opacity: 1;
}

.project-header {
  width: 100%;
  padding: 24px 0;
  background: none;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  outline: none;
  color: inherit;
  gap: 16px;
}

.project-header-left {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
}

.num {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.project-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  transition: transform 0.3s ease;
}

.project-header:hover .project-name {
  transform: translateX(4px);
}

.project-one-liner {
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.4;
}

.project-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}

.toggle-icon {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 300;
  color: var(--muted);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, color 0.3s ease;
}

.project-item.active .toggle-icon {
  transform: rotate(45deg);
  color: var(--text);
}

/* Expandable Body */
.project-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item.active .project-body {
  grid-template-rows: 1fr;
}

.project-body-inner {
  overflow: hidden;
}

.thought-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}

.thought-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thought-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.thought-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
}

.project-action {
  padding-bottom: 28px;
  padding-top: 8px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: gap 0.2s ease;
}

.project-link:hover {
  gap: 14px;
}

@media (max-width: 640px) {
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .project-header-right {
    width: 100%;
    justify-content: space-between;
  }
  .thought-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* About */
.about-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.9;
  font-weight: 300;
}

/* Footer */
footer {
  padding-top: 40px;
  padding-bottom: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

footer span#year {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* Scroll animations */
.animate {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-item.animate:nth-child(2) { transition-delay: 0.08s; }
.project-item.animate:nth-child(3) { transition-delay: 0.16s; }
.project-item.animate:nth-child(4) { transition-delay: 0.24s; }

/* Responsive — tablet */
@media (max-width: 768px) {
  nav,
  .hero,
  .section,
  footer {
    padding-left: 32px;
    padding-right: 32px;
  }

  .hero {
    padding-top: 120px;
    padding-bottom: 80px;
  }

  .hero-bottom {
    flex-direction: column-reverse;
    gap: 24px;
  }

  .hero-photo,
  .hero-photo img,
  .photo-placeholder {
    width: 96px;
    height: 96px;
  }

  .project-desc,
  .about-text {
    max-width: 100%;
  }
}

/* Responsive — mobile */
@media (max-width: 480px) {
  nav,
  .hero,
  .section,
  footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  nav {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .hero {
    padding-top: 100px;
    padding-bottom: 64px;
  }

  .hero-photo,
  .hero-photo img,
  .photo-placeholder {
    width: 80px;
    height: 80px;
  }

  .hero-links {
    flex-wrap: wrap;
    gap: 14px;
  }

  .project-name {
    font-size: 22px;
  }

  .project-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .tags {
    justify-content: flex-start;
  }

  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .project-list:hover .project-item {
    opacity: 1;
  }

  .project-list:hover .project-item:hover::after {
    transform: scaleX(0);
  }

  .project-list:hover .project-item:hover .project-name {
    transform: none;
  }
}
