/* ------------------
               Design tokens
            ------------------ */

/* 🚧 Auto/manual Light - Dark under development */
:root {
  --bg: #ffffff;
  --text: #0b0f10;
  --muted: #667085;
  --brand: #2e7dff;
  --brand-2: #00c2a8; /* accent for subtle highlights */
  --card: #f5f7fb;
  --ring: rgba(46, 125, 255, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f10;
    --text: #f1f5f9;
    --muted: #8b98a5;
    --brand: #a590e8;
    --brand-2: #e57373;
    --card: #12171c;
    --ring: rgba(106, 164, 255, 0.45);
  }
}
[data-theme="dark"] {
  --bg: #0b0f10;
  --text: #f1f5f9;
  --muted: #8b98a5;
  --brand: #6aa4ff;
  --brand-2: #32e2ca;
  --card: #12171c;
  --ring: rgba(106, 164, 255, 0.45);
}

/* ------------------
               Base styles
            ------------------ */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Noto Sans, "Apple SD Gothic Neo", "Pretendard", Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 10px;
}
img {
  max-width: 100%;
  display: block;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

/* ------------------
               Layout: Scroll Snap
            ------------------ */
.snap-container {
  height: 100vh; /* Full viewport */
  overflow-y: scroll;
  scroll-snap-type: y mandatory; /* key line */
  scroll-behavior: smooth;
}
section.panel {
  position: relative;
  min-height: 100vh; /* Each panel fills screen */
  padding: clamp(20px, 4vw, 56px);
  display: grid;
  place-items: center;
  scroll-snap-align: start; /* locks to top */
  background: var(--bg);
}
.panel-inner {
  width: min(1100px, 92vw);
  display: grid;
  gap: clamp(16px, 3vw, 28px);
}
.center {
  text-align: center;
}

/* Quick fly-up when leaving (the “슉!”) */
@keyframes flyUp {
  from {
    filter: none;
    transform: translateY(0);
    opacity: 1;
  }
  to {
    filter: blur(4px);
    transform: translateY(-14%);
    opacity: 0.15;
  }
}
.panel.leaving .panel-inner {
  animation: flyUp 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ------------------
               Top utility bar
            ------------------ */
.topbar {
  position: fixed;
  inset: 12px 12px auto auto;
  z-index: 50;
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none; /* a tag - no underline */
  box-sizing: border-box; /* padding matches for a tag and button */
  line-height: 1; /* button size matches for a tag and button */
  background: var(--card);
  font-size: 0.9rem;
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.5);
}
.btn:active {
  /* filter: brightness(0.7); */
  transform: scale(0.96); /* slightly pressed look */
}
.btn:focus {
  filter: brightness(1.5);
}

/* ------------------
               HERO
            ------------------ */
.hero {
  display: grid;
  gap: 24px;
  align-items: center;
  justify-items: center;
  position: relative;
}
.avatar {
  flex: 0 0 auto;
  align-self: center;
  width: clamp(120px, 40vw, 320px);
  aspect-ratio: 1/1;
  border-radius: 28px; /* soft rounded, not perfect circle to avoid squared look */
  object-fit: cover;
  object-position: center 20%;
  box-shadow: 0 10px 40px var(--brand);
  background-color: var(--brand);
}

.headline {
  font-size: clamp(28px, 7vw, 64px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.kicker {
  color: var(--muted);
  font-size: clamp(12px, 2.6vw, 16px);
  letter-spacing: 0.25px;
  margin: 0;
}
.big-kw {
  font-size: clamp(18px, 4.5vw, 28px);
  font-weight: 700;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-height: 1.2em;
  margin: 10px 0;
}
.cta-row {
  display: flex;
  gap: 14px;
}
.cta-primary {
  background: var(--brand);
  color: var(--bg);
  border: none;
}
.cta-primary:hover {
  filter: brightness(1.08);
}

/* ------------------
               BIO / PROJECTS / CONTACT panels
            ------------------ */
.card {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
  padding: clamp(16px, 3.5vw, 28px);
  border-radius: 18px;
}

/* Layout */

.grid-2 {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr; /* mobile: colum 1 */
  max-width: 1100px; /* centering purpose */
  margin: 0 auto;
}
@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1.2fr 0.8fr; /* desktop: colum 2 */
    align-items: start; /* Tech Stack appears at the top - same as the section title */
  }
}

/* Section Title */
.section-title {
  margin-bottom: 12px;
  font-weight: 700;
}

.about-card {
  display: flex;
  flex-direction: column;
}

/* Card Title (sub title) */
.card-title {
  margin-bottom: 20px;
  font-weight: 600;
}

/* Bio slides */
.about-slide {
  display: none;
}
.about-slide.active {
  display: block;
}

.about-nav {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
}
.about-nav button {
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.about-nav button:hover {
  /* background: #666; */
}

/* Tech Stack */
.techstack ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.techstack li {
  margin: 6px 0;
}
.list-clean {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.projects a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
}
.projects a:hover {
  filter: brightness(1.35);
}
.projects a:active {
  transform: scale(0.98); /* slightly pressed */
}
/* Connect */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 24px; /* between icons */
  flex-wrap: wrap;
}
.socials-icon {
  width: 36px;
  height: 36px;
  filter: grayscale(1) brightness(0.8);
  transition: filter 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}
.socials-icon.linkedin {
  filter: invert(50%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%)
    contrast(103%);
}
.socials-icon:hover {
  filter: none; /* return to original color */
  transform: scale(1.1); /* slightly bigger on hover */
}
.socials-icon.linkedin:hover {
  filter: invert(37%) sepia(91%) saturate(7472%) hue-rotate(186deg)
    brightness(91%) contrast(101%);
}
/* ------------------
            Dot nav (section nav)
            ------------------ */
.dots {
  position: fixed;
  right: 18px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  gap: 10px;
  z-index: 40;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--text) 30%, transparent);
  border: 2px solid transparent;
  cursor: pointer;
}
.dot[aria-current="true"] {
  background: var(--brand);
  border-color: color-mix(in oklab, var(--bg) 60%, transparent);
}
/* 👈 햄버거 버튼 기본 숨김 */
.hamburger {
  display: none;
  padding: 6px 10px;
}
.hamburger svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  stroke-width: 2;
  display: block;
}
/* hamburger menu for mobile */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  right: 16px;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  border-radius: 12px;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  z-index: 70;
}
.mobile-menu.show {
  display: flex;
}
.mobile-menu a {
  color: var(--text);
  text-decoration: none;
}
.mobile-menu a:hover {
  color: var(--brand);
}

/* Responsive: hide dots, show hamburger on small screen */
@media (max-width: 860px) {
  .dots {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .contact {
    display: none;
  }
}
/* ------------------
               Small helpers
            ------------------ */
.muted {
  color: var(--muted);
}

/* ------------------
               Chat bubble flow
            ------------------ */
/* .chat-shell {
        margin-top: clamp(20px, 4vw, 40px);
        padding: clamp(16px, 3vw, 24px);
        border-radius: 20px;
        background: var(--card);
        border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
        box-shadow: 0 18px 40px color-mix(in oklab, var(--text) 6%, transparent);
        display: grid;
        gap: clamp(14px, 2.5vw, 22px);
      } */

/* place chat to the right of the centered avatar with an explicit gap */
.hero-chat {
  position: absolute;
  top: 0;
  left: 70%;
  transform: none;
  transition: width 0.35s ease;
  box-sizing: border-box;
}
/* Desktop */
@media (min-width: 861px) {
  .hero-chat {
    width: 130px; /* smaller bubble to start with */
  }
  .hero-chat.expanded {
    width: clamp(260px, 28vw, 470px); /* expand on interaction */
  }
}

/* Mobile */
@media (max-width: 860px) {
  .hero-chat {
    position: static;
    width: 100%; /* full width of desktop*/
    transform: none;
    left: auto;
    margin-top: clamp(20px, 4vw, 40px);
  }
  .hero-chat.expanded {
    width: 100%;
  }
}
.chat-title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(18px, 3.6vw, 24px);
  text-align: center;
}
.chat-flow {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bubble {
  position: relative;
  background: var(--bg);
  color: inherit;
  border-radius: 18px;
  padding: 14px 18px;
  max-width: 580px;
  border: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
  box-shadow: 0 12px 32px color-mix(in oklab, var(--text) 8%, transparent);
  transition: transform 240ms ease, opacity 240ms ease, box-shadow 240ms ease;
  opacity: 0;
  transform: translateY(10px);
  line-height: 1.3;
}
/* chat bubble tail */
.chat-flow .bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-bottom: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
  transform: rotate(45deg);
}

/* chat bubble tail - odd number */
.chat-flow .bubble:nth-child(odd)::after {
  right: 24px;
  left: auto;
}

/* chat bubble tail - even number */
.chat-flow .bubble:nth-child(even)::after {
  left: 24px;
  right: auto;
}
.bubble-enter {
  opacity: 1;
  transform: translateY(0);
}
.bubble button,
.bubble input,
.bubble select,
.bubble textarea {
  font: inherit;
  color: inherit;
}
.bubble.bubble-action {
  cursor: pointer;
  text-align: left;
}
.bubble.bubble-action:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 4px;
}
.bubble-shake {
  animation: bubbleShake 800ms ease-in-out infinite;
}
@keyframes bubbleShake {
  0%,
  100% {
    transform: translateY(0) rotate(0.3deg);
  }
  20% {
    transform: translateY(-1px) rotate(-1deg);
  }
  40% {
    transform: translateY(1px) rotate(1deg);
  }
  60% {
    transform: translateY(-1px) rotate(-0.6deg);
  }
  80% {
    transform: translateY(1px) rotate(0.6deg);
  }
}
.chat-form {
  display: grid;
  gap: 12px;
}
.chat-question {
  margin: 0;
  font-weight: 600;
}
.chat-template {
  line-height: 1.3;
}
.inline-input,
.inline-number,
.inline-select {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  line-height: 1.2;
  vertical-align: middle;
  border: 1px solid color-mix(in oklab, var(--text) 16%, transparent);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg) 88%, white 12%);
}
.inline-number {
  width: 90px;
}
.inline-select {
  margin-left: 6px;
}
.chat-submit {
  justify-self: end;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 14px;
  cursor: pointer;
  transition: filter 160ms ease;
  line-height: 1.3;
}
.chat-submit:hover {
  filter: brightness(1.08);
}
.chat-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.bubble-quiet {
  background: color-mix(in oklab, var(--card) 80%, var(--bg) 20%);
}
.bubble-quiet::after {
  background: inherit;
}
