:root {
  --bg: #f6f2e9;
  --bg-alt: #efe8db;
  --surface: #fffdf8;
  --surface-strong: #fff8ee;
  --ink: #1f1f1c;
  --ink-soft: #52524b;
  --line: #d9cfbe;
  --accent: #0f4c5c;
  --accent-soft: #3f6a76;
  --gold: #b87b33;
  --shadow: 0 18px 40px rgba(35, 32, 24, 0.08);
  --radius-lg: 24px;
  --radius-md: 14px;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Literata', serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.85;
  background:
    radial-gradient(circle at 8% 4%, rgba(184, 123, 51, 0.12) 0 160px, transparent 260px),
    radial-gradient(circle at 92% 96%, rgba(15, 76, 92, 0.1) 0 180px, transparent 300px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.5;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.24s ease, opacity 0.24s ease, transform 0.24s ease;
}

a:hover {
  color: #0a3b47;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold) !important;
  outline-offset: 3px;
  border-radius: 5px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
  outline: none !important;
}

.skip-link {
  z-index: 9999;
}

.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;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  clip: auto;
  width: auto;
  height: auto;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 2.4rem));
  margin: clamp(1.2rem, 2.5vw, 2.4rem) auto;
  padding: clamp(1.5rem, 2.2vw, 2.5rem);
  background: linear-gradient(165deg, rgba(255, 253, 248, 0.97), rgba(255, 250, 241, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: rise 0.65s ease both;
}

header {
  margin-bottom: 2rem;
}

h1,
h2,
h3,
.site-title,
.site-title a,
.title {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
}

h3 {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
}

p,
li,
figcaption,
.post-excerpt,
.meta-text,
.copyright {
  color: var(--ink-soft);
  font-size: 1.03rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}

nav .separator {
  color: var(--line);
}

nav a {
  text-decoration: none;
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

nav a:hover,
nav a.active,
.back-link:hover {
  color: var(--accent);
  border-color: var(--line);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

main {
  margin-top: 1.5rem;
}

footer {
  margin-top: 2.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.social-links a {
  text-decoration: none;
  padding: 0.28rem 0.56rem;
  border-radius: 7px;
}

.page-home .container,
.page-blog .container {
  max-width: 980px;
}

.page-home header {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.page-home .profile-image {
  width: 156px;
  height: 156px;
  border-radius: 24px;
  object-fit: cover;
  border: 3px solid rgba(15, 76, 92, 0.18);
  box-shadow: 0 15px 30px rgba(15, 76, 92, 0.17);
  filter: saturate(1.07);
}

.page-home .title {
  color: var(--accent-soft);
  font-size: 1.02rem;
  margin-top: 0.3rem;
}

.page-home main {
  display: grid;
  gap: 1.1rem;
}

.page-home article,
.page-home section {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  animation: rise 0.6s ease both;
}

.page-home section:nth-of-type(1) {
  animation-delay: 0.06s;
}

.page-home section:nth-of-type(2) {
  animation-delay: 0.12s;
}

.page-home section:nth-of-type(3) {
  animation-delay: 0.18s;
}

.page-home .bio p {
  font-size: 1.12rem;
  line-height: 1.9;
}

.page-home .education-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-home .education-list li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(15, 76, 92, 0.18);
}

.page-home .education-list li:last-child {
  border-bottom: 0;
}

.page-home .skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.page-home .skill {
  border: 1px solid rgba(15, 76, 92, 0.2);
  border-radius: 999px;
  background: #fff;
  padding: 0.28rem 0.72rem;
  font-size: 0.9rem;
  color: #194c56;
}

.page-blog header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-blog .site-title a {
  text-decoration: none;
}

.page-blog .page-header {
  margin-bottom: 1.2rem;
  padding: 0.3rem 0;
}

.page-blog .page-description {
  max-width: 40ch;
  font-size: 1.1rem;
}

.page-blog .posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.95rem;
}

.page-blog .post-item {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1.1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.6s ease both;
}

.page-blog .post-item:nth-child(1) {
  animation-delay: 0.06s;
}

.page-blog .post-item:nth-child(2) {
  animation-delay: 0.12s;
}

.page-blog .post-item:nth-child(3) {
  animation-delay: 0.18s;
}

.page-blog .post-item:nth-child(4) {
  animation-delay: 0.24s;
}

.page-blog .post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(25, 30, 31, 0.08);
}

.page-blog .post-date {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #6b665d;
  text-transform: uppercase;
}

.page-blog .post-title a {
  text-decoration: none;
  color: var(--ink);
}

.page-blog .post-title a:hover {
  color: var(--accent);
}

.page-blog .coming-soon {
  margin-top: 1rem;
  font-style: italic;
  color: #655f54;
}

.page-article .container {
  max-width: 900px;
}

.page-article header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
}

.page-article .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  text-decoration: none;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #56544f;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
}

.page-article .article-meta {
  margin: 0.9rem 0 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.page-article .pill {
  background: rgba(15, 76, 92, 0.09);
  color: #124754;
  border-radius: 999px;
  padding: 0.24rem 0.64rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.page-article .lead {
  font-size: 1.23rem;
  line-height: 1.8;
  color: #3f3d38;
  max-width: 52ch;
  margin-top: 0.7rem;
  padding-left: 0.9rem;
  border-left: 3px solid rgba(184, 123, 51, 0.5);
}

.page-article article {
  max-width: 74ch;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(1.1rem, 2.2vw, 1.8rem);
}

.page-article article p,
.page-article article li,
.page-article article figcaption,
.page-article article td,
.page-article article th {
  font-size: 1.05rem;
}

.page-article article > p:first-of-type::first-letter {
  float: left;
  font-size: 3rem;
  line-height: 0.92;
  padding-right: 0.3rem;
  color: var(--accent);
  font-family: var(--font-display);
}

.page-article blockquote {
  margin: 1.4rem 0;
  border-left: 4px solid rgba(15, 76, 92, 0.42);
  padding: 0.5rem 0 0.5rem 0.9rem;
  background: rgba(255, 248, 231, 0.8);
  border-radius: 0 10px 10px 0;
}

.page-article figure {
  margin: 1.3rem 0;
  padding: 0.9rem;
  background: #fffcf6;
  border: 1px solid rgba(15, 76, 92, 0.16);
  border-radius: 12px;
}

.page-article figure svg,
.page-article figure table {
  width: 100%;
}

.page-article figure svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.page-article figcaption {
  margin-top: 0.5rem;
  font-size: 0.92rem;
}

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

.page-article table {
  border-collapse: collapse;
}

.page-article table th,
.page-article table td {
  border: 1px solid #dacdb8;
  background: rgba(255, 255, 255, 0.66);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.page-article blockquote .source {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-style: italic;
}

.page-article .kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.page-article .kpi {
  flex: 1 1 220px;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: rgba(15, 76, 92, 0.09);
  border: 1px solid var(--line);
}

.page-article .kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b665d;
  margin-bottom: 0.3rem;
}

.page-article .kpi-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.page-article .badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.page-article .small {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.page-article .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b665d;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.page-article .tag-row {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.page-article .related-articles h3 {
  margin-top: 1.4rem !important;
  margin-bottom: 0.8rem !important;
  color: #6f684f !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.page-article .related-articles ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-article .related-articles li {
  margin-bottom: 0.55rem !important;
}

.page-article .related-articles a {
  color: #124754 !important;
  text-decoration: none !important;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.page-article .related-articles a:hover {
  color: #0a3b47 !important;
  text-decoration: underline !important;
}

.page-404 {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.page-404 .container {
  max-width: 680px;
  text-align: center;
}

.page-404 h1 {
  font-size: clamp(4.6rem, 15vw, 8rem);
  color: var(--accent);
  margin-bottom: 0;
}

.page-404 h2 {
  margin-top: 0.2rem;
}

.page-404 p {
  max-width: 35ch;
  margin: 0.8rem auto 1.6rem;
  font-size: 1.16rem;
}

.page-404 a {
  display: inline-block;
  padding: 0.66rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  html {
    font-size: 17px;
  }

  .page-home .profile-image {
    width: 136px;
    height: 136px;
  }

  .page-article .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .container {
    width: calc(100% - 1.3rem);
    padding: 1rem;
    border-radius: 16px;
  }

  nav {
    gap: 0.35rem;
  }

  nav a {
    font-size: 0.82rem;
    padding: 0.26rem 0.56rem;
  }

  .page-home .bio p,
  .page-blog .page-description,
  .page-article .lead,
  .page-404 p {
    font-size: 1.04rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
