* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.portfolio-page {
  margin: 0;
  font-family: "Noto Sans KR", Inter, sans-serif;
  background: var(--shell-bg);
  color: var(--shell-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.portfolio-page .container {
  width: min(calc(100% - 3rem), 1120px);
  margin: 0 auto;
}

.portfolio-page h1,
.portfolio-page h2,
.portfolio-page h3,
.portfolio-page p,
.portfolio-page figure,
.portfolio-page dl,
.portfolio-page dd { margin-top: 0; }

.hero {
  min-height: calc(100vh - 64px);
  display: grid;
  align-items: center;
  padding: 5rem 0;
  border-bottom: 1px solid var(--shell-border);
  background:
    radial-gradient(circle at 76% 34%, color-mix(in srgb, var(--shell-accent) 9%, transparent), transparent 28rem),
    var(--shell-bg);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 5rem;
  align-items: center;
}

.hero-kicker,
.section-heading > p,
.contact-panel > div > p {
  margin-bottom: 0.75rem;
  color: var(--shell-muted);
  font: 700 0.78rem/1.3 Inter, sans-serif;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 1.5rem;
  font: 800 clamp(2.55rem, 5.2vw, 4.25rem)/1.12 Inter, "Noto Sans KR", sans-serif;
  letter-spacing: -0.055em;
  word-break: keep-all;
}

.hero h1 span { color: var(--shell-muted); }

.hero-description {
  max-width: 620px;
  margin-bottom: 2rem;
  color: var(--shell-muted);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--shell-border);
  border-radius: 0.6rem;
  color: var(--shell-text);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease;
}

.button:hover { transform: translateY(-2px); }

.button-primary {
  border-color: var(--shell-text);
  background: var(--shell-text);
  color: var(--shell-bg);
}

.button-secondary { background: var(--shell-surface); }

.profile-card {
  position: relative;
  justify-self: center;
  margin-bottom: 0;
}

.profile-card img {
  display: block;
  width: min(28vw, 320px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--shell-border);
  border-radius: 50%;
  filter: saturate(0.72);
}

.profile-card figcaption {
  position: absolute;
  left: 50%;
  bottom: -0.75rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  transform: translateX(-50%);
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: var(--shell-surface);
  color: var(--shell-text);
  font: 700 0.76rem/1.2 Inter, sans-serif;
}

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }

.section + .section { border-top: 1px solid var(--shell-border); }

.section-heading {
  max-width: 700px;
  margin-bottom: 2.5rem;
}

.section-heading h2,
.contact-panel h2 {
  margin-bottom: 0.5rem;
  font: 800 clamp(2rem, 4.5vw, 3.4rem)/1.18 Inter, "Noto Sans KR", sans-serif;
  letter-spacing: -0.045em;
}

.section-heading > span { color: var(--shell-muted); }

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
}

.about-copy { color: var(--shell-muted); }

.about-copy p { margin-bottom: 1.2rem; }

.skill-list,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-list { margin-top: 2rem; }

.skill-list span,
.project-tags span {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: var(--shell-surface);
  color: var(--shell-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.proof-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--shell-border);
}

.proof-grid div {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--shell-border);
}

.proof-grid dt {
  font: 800 1.7rem/1.2 Inter, sans-serif;
  letter-spacing: -0.04em;
}

.proof-grid dd { color: var(--shell-muted); }

.projects-section,
.writing-section { background: color-mix(in srgb, var(--shell-surface) 55%, var(--shell-bg)); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--shell-border);
  border-radius: 0.9rem;
  background: var(--shell-surface);
  transition: transform 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--shell-muted);
}

.project-card h3 {
  margin: 1.25rem 0 0.75rem;
  font: 750 1.35rem/1.35 Inter, "Noto Sans KR", sans-serif;
  letter-spacing: -0.025em;
}

.project-card > p {
  flex: 1;
  margin-bottom: 1.5rem;
  color: var(--shell-muted);
}

.project-card > a,
.text-link {
  width: fit-content;
  color: var(--shell-text);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.section-action { margin-top: 2rem; }

.writing-list {
  border-top: 1px solid var(--shell-border);
}

.writing-list article {
  display: grid;
  grid-template-columns: 110px minmax(180px, 0.7fr) 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--shell-border);
}

.writing-list time,
.writing-list p { color: var(--shell-muted); }

.writing-list h3 { margin-bottom: 0; }

.writing-list h3 a { color: inherit; text-decoration: none; }

.writing-list p { margin-bottom: 0; }

.empty-state {
  padding: 2rem;
  border: 1px solid var(--shell-border);
  border-radius: 0.9rem;
  background: var(--shell-surface);
}

.empty-state p { margin: 0.5rem 0 0; color: var(--shell-muted); }

.contact-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4rem) !important;
  border: 1px solid var(--shell-border);
  border-radius: 1rem;
  background: var(--shell-surface);
}

.contact-panel h2 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); }

.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border: 1px solid var(--shell-border);
  border-radius: 50%;
  background: var(--shell-surface);
  color: var(--shell-text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.scroll-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }

@media (max-width: 800px) {
  .hero { min-height: auto; padding: 4rem 0; }
  .hero-content { grid-template-columns: 1fr; gap: 3rem; }
  .hero-text { order: 2; }
  .profile-card { order: 1; }
  .profile-card img { width: 200px; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-panel { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .portfolio-page .container { width: min(calc(100% - 2rem), 1120px); }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 3.5rem); }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card { min-height: auto; }
  .writing-list article { grid-template-columns: 1fr; gap: 0.4rem; }
  .section { padding: 4rem 0; }
  .button { width: 100%; }
  .hero-actions, .contact-actions { width: 100%; }
}
