:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-card: #1c2330;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --accent-hover: #79b8ff;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  --header-h: 64px;
  --max-w: 1160px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

/* Skip link */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #0d1117;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  color: #0d1117;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.site-logo {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-logo span {
  color: var(--text);
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
  border-radius: 6px;
  flex-shrink: 0;
}

.nav-toggle__icon {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease;
}

.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #0d1117;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #0d1117;
  transform: translateY(-1px);
}

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

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

/* Hero */

.hero {
  padding: 5.5rem 0 4.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(88, 166, 255, 0.08), transparent),
    var(--bg);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3.5rem;
  align-items: center;
}

.hero__name {
  margin: 0 0 0.6rem;
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--text);
}

.hero__role {
  margin: 0 0 1rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--accent);
  font-weight: 500;
}

.hero__current {
  margin: 0 0 1.25rem;
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  max-width: fit-content;
  line-height: 1.45;
}

.hero__current-note {
  color: var(--text-muted);
  font-weight: 400;
}

.hero__tagline {
  margin: 0 0 1.5rem;
  max-width: 48ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.hero__highlights li {
  padding: 0.35rem 0.85rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(88, 166, 255, 0.2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 3px solid var(--border);
  box-shadow:
    0 0 0 4px rgba(88, 166, 255, 0.08),
    var(--shadow);
  flex-shrink: 0;
  overflow: hidden;
}

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

/* Sections */

.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section__title {
  margin: 0 0 2rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section__lead {
  margin: -1rem 0 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.subsection__title {
  margin: 3rem 0 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* About */

.about__intro {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 68ch;
}

/* Bento grid */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.bento-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.bento-card:hover {
  border-color: rgba(88, 166, 255, 0.3);
}

.bento-card__title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.bento-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Own project */

.own-project {
  background: var(--bg-card);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  background-image:
    linear-gradient(135deg, rgba(88, 166, 255, 0.05) 0%, transparent 45%),
    linear-gradient(var(--bg-card), var(--bg-card));
}

.own-project__badge {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-soft);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.own-project__header {
  margin-bottom: 1rem;
}

.own-project__logo img {
  height: 32px;
  width: auto;
}

.own-project__desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 72ch;
}

.own-project__desc:last-of-type {
  margin-bottom: 1.5rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.project-gallery__item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.project-gallery__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-detail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.project-detail__block h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.project-detail__block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.project-detail__block .tag-list {
  margin-bottom: 0;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.project-card__link::after {
  content: "→";
  transition: transform 0.15s ease;
}

.project-card__link:hover::after {
  transform: translateX(3px);
}

/* AI section */

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.ai-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.ai-card--wide {
  grid-column: 1 / -1;
}

.ai-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.ai-card__logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.ai-card__header .ai-card__title {
  margin: 0;
}

.ai-card__header-sep {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.5;
}

.ai-card__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.ai-card__desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.ai-card__note {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.ai-card__note--planned {
  margin-top: 1.25rem;
  padding-top: 0;
  border-top: none;
  font-size: 0.85rem;
}

.ai-status-group {
  margin-bottom: 1rem;
}

.ai-status-group:last-of-type {
  margin-bottom: 0;
}

.ai-status-group__label {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.ai-samiku-blocks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.ai-samiku-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.ai-samiku-block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.ai-samiku-block code {
  padding: 0.1rem 0.35rem;
  background: var(--bg-elevated);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
}

/* Tags */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.28rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline .tag-list {
  margin-bottom: 0;
}

.timeline .tag-list li {
  background: var(--accent-soft);
  border-color: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

/* Experience timeline */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline--compact {
  gap: 1.25rem;
}

.timeline__item {
  position: relative;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__period {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.timeline__role {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline__company {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline__note {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

.timeline__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.timeline__bullets {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.timeline__bullets li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.timeline__bullets li:last-child {
  margin-bottom: 0;
}

/* Stack / Technologies */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.stack-group {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stack-group h3 {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.stack-group .tag-list {
  margin-bottom: 0;
}

.languages {
  margin: 2rem 0 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.languages strong {
  color: var(--text);
}

/* Contact */

.contact-cta {
  margin: -0.5rem 0 1rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 58ch;
  line-height: 1.6;
}

.contact__location {
  margin: 0 0 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.contact__location::before {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  margin-right: 0.65rem;
  background: var(--border);
  vertical-align: middle;
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 560px;
}

.contact__item {
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.contact__value {
  font-weight: 500;
  word-break: break-word;
}

.contact__value--linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact__icon {
  flex-shrink: 0;
}

/* Footer */

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.site-footer__meta {
  margin-top: 0.25rem !important;
  font-size: 0.78rem;
  opacity: 0.6;
}

/* Responsive — 1024px */

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

  .ai-card--wide {
    grid-column: auto;
  }

  .ai-samiku-blocks {
    grid-template-columns: 1fr;
  }
}

/* Responsive — 768px */

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  .site-logo {
    font-size: 0.85rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero__tagline {
    margin-inline: auto;
  }

  .contact__location {
    text-align: center;
  }

  .contact__location::before {
    display: none;
  }

  .hero__current {
    margin-inline: auto;
    text-align: center;
  }

  .hero__highlights {
    justify-content: center;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__avatar {
    margin-inline: auto;
    order: -1;
    width: 160px;
    height: 160px;
  }

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

  .contact__grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .section {
    padding: 3rem 0;
  }

  .own-project {
    padding: 1.5rem;
  }
}

/* Responsive — 375px and 320px */

@media (max-width: 375px) {
  .container {
    width: min(100% - 1.25rem, var(--max-w));
  }

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

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

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .hero__highlights li {
    font-size: 0.78rem;
  }

  .site-logo {
    font-size: 0.8rem;
    max-width: 55vw;
  }
}

/* Responsive — 1440px */

@media (min-width: 1440px) {
  :root {
    --max-w: 1200px;
  }

  .section {
    padding: 4.5rem 0;
  }

  .hero {
    padding: 6rem 0 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
