:root {
  --bg: #f6f8fb;
  --bg-soft: #eef4f6;
  --text: #111827;
  --muted: #5b6676;
  --surface: #ffffff;
  --surface-soft: #f9fbfc;
  --line: #dce3ea;
  --line-strong: #c7d3dd;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #e4f4f2;
  --blue: #2563eb;
  --amber: #d97706;
  --rose: #be3455;
  --ink: #0f172a;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.07);
  --max: 1120px;
  --wide: 1240px;
  --page-x: clamp(18px, 5vw, 72px);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.07) 0%, rgba(37, 99, 235, 0.04) 34%, rgba(255, 255, 255, 0) 68%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #edf5f3 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

main {
  flex: 1;
}

img,
video {
  max-width: 100%;
}

a {
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.08;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(3.1rem, 8vw, 6.9rem);
  font-weight: 850;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  font-weight: 820;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

p {
  margin-bottom: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px var(--page-x);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(220, 227, 234, 0.86);
  backdrop-filter: blur(18px);
}

.logo {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 850;
  white-space: nowrap;
}

.logo:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

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

.nav a {
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 750;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  width: min(100%, var(--wide));
  min-height: calc(100svh - 134px);
  margin: 0 auto;
  padding: clamp(58px, 9vw, 104px) var(--page-x) clamp(54px, 8vw, 90px);
}

.home-main .hero {
  grid-template-columns: minmax(0, 820px);
  justify-content: start;
  min-height: calc(100svh - 120px);
  padding-top: clamp(42px, 7vw, 74px);
  padding-bottom: clamp(34px, 6vw, 58px);
}

.hero-text {
  max-width: 820px;
}

.eyebrow,
.tag {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-intro {
  max-width: 720px;
  color: #334155;
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.hero-detail {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.button:hover {
  color: #ffffff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
  text-decoration: none;
  transform: translateY(-2px);
}

.button-secondary {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-strong);
  box-shadow: none;
}

.button-secondary:hover {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--accent);
}

.hero-panel {
  position: relative;
  padding: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(199, 211, 221, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel::before {
  content: "";
  display: block;
  height: 8px;
  margin: -28px -28px 24px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--amber));
}

.hero-panel-list {
  display: grid;
  gap: 12px;
}

.hero-panel-list span {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 750;
}

.section,
.page {
  padding-right: var(--page-x);
  padding-left: var(--page-x);
}

.section {
  padding-top: clamp(56px, 8vw, 88px);
  padding-bottom: clamp(56px, 8vw, 88px);
}

.page {
  min-height: calc(100svh - 136px);
  padding-top: clamp(48px, 7vw, 80px);
  padding-bottom: clamp(58px, 8vw, 92px);
}

.page > section,
.featured-heading,
.featured-section .grid,
.skills-cards,
.process-steps,
.cta-section {
  width: min(100%, var(--max));
  margin-right: auto;
  margin-left: auto;
}

.page h1 {
  font-size: clamp(2.55rem, 6vw, 4.8rem);
}

.section-intro {
  max-width: 720px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-intro p:not(.eyebrow),
.page-heading p,
.about-layout p,
.card p,
.post p,
.process-steps p,
.cta-section p:not(.eyebrow),
.contact-hero p,
.article-content p,
.article-media figcaption,
.article-image figcaption {
  color: var(--muted);
}

.page-heading {
  max-width: 760px;
  margin-bottom: 30px;
}

.page-heading p {
  font-size: 1.06rem;
}

.featured-section {
  background: rgba(255, 255, 255, 0.46);
  border-top: 1px solid rgba(220, 227, 234, 0.72);
  border-bottom: 1px solid rgba(220, 227, 234, 0.72);
}

.featured-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.featured-heading h2 {
  margin-bottom: 0;
}

.grid,
.skills-grid,
.project-summary,
.process-steps,
.skills-cards {
  display: grid;
  gap: 20px;
}

.grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.skills-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.post,
.info-box,
.contact-card,
.project-summary article,
.process-steps article {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card,
.post,
.info-box,
.contact-card {
  padding: 24px;
}

.card,
.post,
.project-summary article,
.process-steps article,
.skill-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover,
.post:hover,
.project-summary article:hover,
.process-steps article:hover,
.skill-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.feature-card,
.project-card {
  display: flex;
  flex-direction: column;
}

.feature-card {
  min-height: 245px;
}

.feature-card a,
.project-card a,
.post a {
  margin-top: auto;
}

.skills-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(228, 244, 242, 0.58) 100%);
}

.skill-card {
  min-height: 300px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.skill-card h3 {
  margin-bottom: 16px;
  padding-bottom: 12px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.skill-card ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.skill-card li {
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem;
}

.skill-card li::before {
  content: "";
  position: absolute;
  top: 0.78em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
}

.section-block {
  width: min(100%, var(--max));
  margin: 44px auto 0;
}

.project-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 960px;
  margin-bottom: 30px;
}

.project-summary article {
  padding: 20px;
}

.project-summary strong,
.project-summary span {
  display: block;
}

.project-summary strong {
  color: var(--accent-dark);
  font-size: 1.45rem;
  line-height: 1.1;
}

.project-summary span {
  margin-top: 8px;
  color: var(--muted);
}

.compact-grid .card {
  min-height: 178px;
}

.project-card {
  gap: 8px;
  min-height: 100%;
}

.project-thumb {
  display: grid;
  place-items: end start;
  aspect-ratio: 16 / 9;
  margin: -24px -24px 16px;
  padding: 18px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--accent-dark), var(--blue));
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 2rem;
  font-weight: 850;
}

.project-card:nth-child(2n) .project-thumb {
  background: linear-gradient(135deg, #1e3a8a, #7c3aed);
}

.project-card:nth-child(3n) .project-thumb {
  background: linear-gradient(135deg, #334155, var(--rose));
}

.project-card:nth-child(4n) .project-thumb {
  background: linear-gradient(135deg, #0f172a, var(--amber));
}

.project-thumb.image-thumb {
  place-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.project-thumb.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-layout,
.contact-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 34px;
  align-items: start;
}

.about-layout > div,
.contact-hero > div {
  max-width: 760px;
}

.contact-card,
.info-box {
  position: sticky;
  top: 94px;
}

.info-box ul,
.link-list {
  margin: 0;
  padding-left: 20px;
}

.link-list li {
  margin-bottom: 9px;
}

.timeline {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.timeline article {
  padding: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-soft);
}

.post-list {
  display: grid;
  gap: 18px;
  max-width: 820px;
}

.euler-list {
  max-width: 760px;
  margin-top: 20px;
}

.euler-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.euler-list a {
  font-size: 1rem;
}

.post time,
.article-content time {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.post time {
  margin-bottom: 8px;
}

.article-page {
  display: flex;
  justify-content: center;
}

.article-content {
  width: min(100%, 800px);
  padding: clamp(26px, 5vw, 44px);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.article-wide {
  width: min(100%, 1040px);
}

.article-content p {
  line-height: 1.45;
}

.article-content h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
}

.article-content h2 {
  margin-top: 34px;
}

.article-content time {
  margin-bottom: 24px;
}

.article-content .lead {
  color: #334155;
  font-size: 1.16rem;
  line-height: 1.62;
}

.article-content pre {
  overflow-x: auto;
  margin: 24px 0;
  padding: 18px;
  color: #e5edf5;
  background: var(--ink);
  border-radius: var(--radius);
  line-height: 1.35;
}

.article-content code {
  font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
}

.code-listing {
  overflow-x: auto;
  margin: 24px 0;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.code-listing ol {
  min-width: max-content;
  margin: 0;
  padding: 14px 0 14px 54px;
  color: #8a97a6;
  background: repeating-linear-gradient(
    180deg,
    var(--surface) 0,
    var(--surface) 24px,
    var(--surface-soft) 24px,
    var(--surface-soft) 48px
  );
  font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 24px;
}

.code-listing li {
  min-height: 24px;
  padding: 0 18px 0 12px;
}

.code-listing li::marker {
  color: #8a97a6;
  font-size: 0.82rem;
}

.code-listing code {
  color: var(--ink);
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}

.code-pp {
  color: var(--rose);
}

.code-kw {
  color: var(--blue);
}

.code-fn {
  color: var(--accent-dark);
}

.code-num {
  color: var(--amber);
}

.code-str {
  color: var(--accent);
}

.code-comment {
  color: var(--muted);
}

.article-content .formula-box {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: none;
}

.article-media,
.image-gallery {
  margin: 30px 0;
}

.article-media video,
.article-image img {
  display: block;
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.article-media video {
  max-height: 520px;
}

.article-media figcaption,
.article-image figcaption {
  margin-top: 10px;
  font-size: 0.92rem;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.article-image {
  margin: 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
}

.article-actions {
  margin-top: 30px;
}

.process-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-steps article {
  padding: 24px;
}

.process-steps span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent-dark);
  font-weight: 850;
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 52px;
  padding: 30px;
  background: var(--ink);
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cta-section h2,
.cta-section .eyebrow {
  color: #ffffff;
}

.cta-section p:not(.eyebrow) {
  margin-bottom: 0;
  color: #d7dee8;
}

.cta-section .button {
  flex: 0 0 auto;
  background: #ffffff;
  border-color: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.cta-section .button:hover {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 40px;
  padding: 6px var(--page-x);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.35;
}

.footer p {
  margin: 0;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 1100px) {
  .skills-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-panel {
    max-width: 640px;
  }

  .grid,
  .process-steps,
  .project-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --page-x: 18px;
  }

  .site-header {
    display: grid;
    align-items: start;
    gap: 12px;
  }

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

  .nav a {
    padding: 7px 9px;
  }

  .hero {
    padding-top: 46px;
    padding-bottom: 50px;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.4rem);
  }

  .featured-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .grid,
  .process-steps,
  .project-summary,
  .skills-grid,
  .skills-cards,
  .image-gallery {
    grid-template-columns: 1fr;
  }

  .about-layout,
  .contact-hero {
    grid-template-columns: 1fr;
  }

  .contact-card,
  .info-box {
    position: static;
  }

  .cta-section,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .skill-card {
    min-height: auto;
  }

  .article-content {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  :root {
    --page-x: 16px;
  }

  .hero-panel,
  .skill-card,
  .card,
  .post,
  .info-box,
  .contact-card,
  .cta-section {
    padding: 20px;
  }

  .hero-panel::before {
    margin: -20px -20px 20px;
  }

  .project-thumb {
    margin: -20px -20px 14px;
  }

  .button {
    width: 100%;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }
}
