:root {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --bg-soft: #e7eef8;
  --ink: #152033;
  --muted: #5c6b82;
  --line: #d5e0ee;
  --accent: #1d6fe8;
  --accent-strong: #1557c0;
  --accent-ink: #f5f9ff;
  --hero-bg: #0e1b33;
  --hero-ink: #f5f8fc;
  --hero-muted: #c5d2e6;
  --shadow: 0 18px 40px rgba(14, 27, 51, 0.08);
  --radius: 18px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --shell: min(1120px, calc(100% - 2rem));
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d1420;
  --bg-elev: #162033;
  --bg-soft: #1e2c44;
  --ink: #e8eef8;
  --muted: #a9b7cc;
  --line: #2c3d58;
  --accent: #7eb0ff;
  --accent-strong: #b7d2ff;
  --accent-ink: #071426;
  --hero-bg: #0a1220;
  --hero-ink: #f5f8fc;
  --hero-muted: #b7c6dc;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.02rem;
  line-height: 1.65;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 600;
}

p {
  margin: 0 0 0.9rem;
}

ul {
  margin: 0;
  padding: 0;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

section[id],
div[id] {
  scroll-margin-top: 5.5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__photo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand__role {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 1.25rem;
  margin-left: auto;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.is-active,
.current-menu-item > .nav-link,
.current_page_item > .nav-link {
  color: var(--ink);
  background: var(--bg-soft);
}

.nav-toggle,
.theme-toggle,
.to-top,
.button {
  border: 0;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="light"] .icon-moon,
[data-theme="dark"] .icon-sun {
  display: none;
}

.hero {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(126, 176, 255, 0.32), transparent 46%),
    radial-gradient(ellipse at 100% 100%, rgba(29, 111, 232, 0.45), transparent 42%),
    var(--hero-bg);
  color: var(--hero-ink);
  padding: 4.5rem 0 4.75rem;
}

.hero__inner {
  display: grid;
  gap: 1.5rem;
}

.socials {
  display: flex;
  gap: 0.6rem;
  list-style: none;
}

.socials a {
  display: inline-flex;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg-soft);
  text-decoration: none;
}

.socials a:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.hero .socials a {
  color: var(--hero-ink);
  background: rgba(255, 255, 255, 0.08);
}

.hero .socials a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.hero__copy h1,
.hero__copy .hero__name {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.95;
  margin: 0.2rem 0 0.8rem;
  color: white;
}

.hero__kicker,
.hero__kicker p {
  margin: 0;
  color: var(--hero-muted);
  font-size: 1.15rem;
  font-weight: 500;
}

.hero__role {
  margin: 0 0 1.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ec2ff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}

.button:hover {
  color: var(--accent-ink);
  filter: brightness(1.05);
}

.button p {
  margin: 0;
}

.hero .button {
  background: #eef4ff;
  color: #12315f;
}

.section {
  padding: 4.25rem 0;
}

.section--muted {
  background: color-mix(in srgb, var(--bg-soft) 72%, var(--bg));
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 1.6rem;
}

.section-title span {
  color: var(--accent);
}

.about-grid,
.card-grid,
.resume-layout,
.contact-grid,
.split {
  display: grid;
  gap: 1rem;
}

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

.resume-layout {
  grid-template-columns: 1.15fr 0.95fr 0.9fr;
  align-items: start;
}

.contact-grid,
.split {
  grid-template-columns: 1.4fr 0.8fr;
  align-items: stretch;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.35rem 1.2rem;
}

.panel h3,
.panel h2 {
  font-size: 1.25rem;
}

.rule {
  display: block;
  width: 2.4rem;
  height: 3px;
  margin: 0.35rem 0 1rem;
  border-radius: 99px;
  background: var(--accent);
}

.prose,
.entry__text {
  color: var(--ink);
}

.prose > :first-child,
.entry__text > :first-child {
  margin-top: 0;
}

.prose a {
  color: var(--accent);
}

.prose ul,
.prose ol,
.entry__text ul,
.entry__text ol {
  padding-left: 1.15rem;
}

.prose li + li,
.entry__text li + li {
  margin-top: 0.25rem;
}

.prose img,
.entry__text img {
  border-radius: 12px;
}

.prose blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose pre,
.prose code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.prose pre {
  overflow: auto;
  padding: 1rem;
  background: var(--bg-soft);
  border-radius: 12px;
}

.expertise {
  display: grid;
  gap: 1.1rem;
}

.expertise__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
}

.expertise__icon {
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1.4;
}

.expertise__item h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.expertise__item p,
.subtitle {
  color: var(--muted);
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

.entry + .entry {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.entry__date {
  margin: 0 0 0.15rem;
  color: var(--accent);
  font-size: 0.98rem;
}

.entry__place {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.meter {
  height: 0.5rem;
  margin: 0 0 0.95rem;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, white));
}

.skill-name {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.tool-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  list-style: none;
  margin-bottom: 1rem;
}

.tool-list li {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-list img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.learn-card,
.post-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.learn-card {
  padding: 1.2rem 1.2rem 1.3rem;
}

.learn-card__icon {
  color: var(--accent);
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.learn-card h3,
.post-card h3 {
  font-size: 1.12rem;
}

.post-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.15rem 1.2rem;
  flex: 1;
}

.post-card__body p {
  color: var(--muted);
}

.text-link {
  margin-top: auto;
  font-weight: 700;
  text-decoration: none;
}

.section-actions {
  margin-top: 1.4rem;
}

.band {
  padding: 0 0 0.25rem;
}

.band__inner {
  width: var(--shell);
  margin: 0 auto;
  padding: 2.8rem 1.5rem;
  border-radius: 28px;
  text-align: center;
  color: var(--hero-ink);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(126, 176, 255, 0.28), transparent 45%),
    var(--hero-bg);
}

.band__inner h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 1.1rem;
  color: white;
}

.contact {
  padding-bottom: 4rem;
}

.contact-visual {
  width: var(--shell);
  height: 320px;
  margin: 0 auto 1.25rem;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.contact-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 68%;
  display: block;
}

.contact-line {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
}

.contact-line h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

.contact-line span {
  color: var(--muted);
  font-weight: 500;
}

.contact-form {
  position: relative;
}

.contact-form p,
.wpcf7 form p {
  margin-bottom: 0.8rem;
}

.contact-form label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-weight: 600;
}

.contact-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-note {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
}

.contact-note--ok {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev));
  color: var(--ink);
}

.contact-note--error {
  background: color-mix(in srgb, #b42318 12%, var(--bg-elev));
  color: #9f1c14;
}

[data-theme="dark"] .contact-note--error {
  color: #ffb4ab;
}

.wpcf7-form-control:not(.wpcf7-submit),
.panel input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.panel textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}

.wpcf7-form-control:focus,
.panel input:focus,
.panel textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-color: var(--accent);
}

.login-link {
  font-weight: 600;
  white-space: nowrap;
}

.login-screen {
  min-height: calc(100vh - 9rem);
  display: grid;
  place-items: center;
  padding: 3rem 1rem 4rem;
}

.login-card {
  width: min(440px, 100%);
}

.login-card h1 {
  font-size: 1.8rem;
}

.login-card p {
  color: var(--muted);
}

.login-card label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-weight: 600;
}

.login-card .field {
  margin-bottom: 0.9rem;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 1rem;
  color: var(--ink);
}

.login-remember input {
  width: auto;
}

.login-card .button {
  width: 100%;
}

.login-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, #b42318 12%, var(--bg-elev));
  color: #9f1c14;
}

[data-theme="dark"] .login-error {
  color: #ffb4ab;
}

.contact .wpcf7 button[type="submit"],
.contact-form button[type="submit"],
.contact .wpcf7 input[type="submit"],
.wpcf7-submit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: auto;
  min-height: 3.05rem;
  margin-top: 0.35rem;
  padding: 0.85rem 1.55rem 0.85rem 1.7rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 34%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.contact .wpcf7 button[type="submit"]::after,
.contact-form button[type="submit"]::after {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.contact .wpcf7 button[type="submit"]:hover,
.contact-form button[type="submit"]:hover,
.contact .wpcf7 input[type="submit"]:hover,
.wpcf7-submit:hover {
  transform: translateY(-2px);
  color: var(--accent-ink);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 46%, transparent);
}

.contact .wpcf7 button[type="submit"]:disabled,
.contact-form button[type="submit"]:disabled,
.contact .wpcf7 input[type="submit"]:disabled {
  opacity: 0.72;
  cursor: progress;
  transform: none;
}

.wpcf7-not-valid-tip {
  display: block;
  margin-top: 0.3rem;
  color: #b42318;
  font-size: 0.85rem;
}

[data-theme="dark"] .wpcf7-not-valid-tip {
  color: #ffb4ab;
}

.wpcf7-response-output {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.crumbs {
  margin-bottom: 1.2rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--line);
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.article {
  padding: 2.2rem 0 3rem;
}

.article > h1,
.article > h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
}

.article__figure {
  margin: 0 0 1.2rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.article__figure img {
  width: 100%;
  display: block;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

div.page-numbers {
  display: block;
}

.page-numbers ul,
.panel .socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.panel .socials {
  justify-content: flex-start;
}

.page-numbers li {
  list-style: none;
}

.page-numbers a,
.page-numbers span {
  display: inline-flex;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.7rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  text-decoration: none;
}

.page-numbers .current,
.page-numbers a:hover {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.ad-slot {
  width: var(--shell);
  margin: 1.5rem auto;
  overflow: visible;
  text-align: center;
}

.shell .ad-slot {
  width: 100%;
}

.learn-card .button {
  margin-top: auto;
  align-self: flex-start;
}

.post-card h3 a {
  color: inherit;
  text-decoration: none;
}

.post-card,
.learn-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover,
.learn-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.google-auto-placed {
  clear: both;
  margin: 1.5rem auto;
  max-width: 1120px;
}

.site-footer {
  padding: 1.3rem 0 1.6rem;
  background: var(--hero-bg);
  color: var(--hero-muted);
}

.site-footer p {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: white;
  text-decoration: none;
}

.not-found {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.not-found h1 {
  font-size: clamp(4rem, 12vw, 7rem);
  letter-spacing: -0.06em;
  margin-bottom: 0.2rem;
}

.to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 5.5rem;
  z-index: 20;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 980px) {
  .about-grid,
  .card-grid,
  .resume-layout,
  .contact-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .contact-visual {
    height: 220px;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.6rem 1rem 1rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
  }

  .brand__role {
    display: none;
  }
}

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

  .post-card,
  .learn-card,
  .read-progress > span,
  .read-time__value {
    transition: none;
  }
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  pointer-events: none;
}

.read-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.read-time {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.2rem;
  padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 0.95rem;
}

.read-time strong {
  font-variant-numeric: tabular-nums;
}

.read-time__ring {
  width: 42px;
  height: 42px;
  transform: rotate(-90deg);
}

.read-time__track,
.read-time__value {
  fill: none;
  stroke-width: 3;
}

.read-time__track {
  stroke: var(--bg-soft);
}

.read-time__value {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 94.2;
  stroke-dashoffset: 94.2;
}

.read-chip {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 600;
}

[data-theme="dark"] .read-chip {
  color: var(--accent);
}
