/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent: #D4894A;
  --accent-light: #E8A96A;
  --accent-faint: #FDF5ED;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --bg: #FAFAF8;
  --card-bg: #FFFFFF;
  --border: #E8E4DF;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1200px;
  --content-width: 720px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

/* ===== GLOBAL ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}

* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  transition: background 0.4s ease;
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__center {
  display: flex;
  align-items: center;
  gap: 3rem;
  background: #fff;
  padding: 0.75rem 2.5rem;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.nav__brand {
  transition: color 0.3s ease;
}

.nav__tabs {
  display: flex;
  gap: 2rem;
}

.nav--dark .nav__center {
  background: #4A4A4A;
  box-shadow: none;
}

.nav--dark .nav__brand {
  color: #fff;
}

.nav--dark .nav__tab {
  color: #fff;
}

.nav--dark .nav__tab::before {
  background: rgba(255, 255, 255, 0.3);
}

.nav__tab {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav__tab::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transition: background 0.3s ease, transform 0.3s ease;
  transform-origin: left;
}

.nav__tab--active::before,
.nav__tab:hover::before {
  background: var(--accent);
}

.nav__left,
.nav__right {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-width: 200px;
}

.nav__right {
  justify-content: flex-end;
}

.nav__link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav__link:hover {
  color: var(--accent);
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

/* Mobile menu */
.nav__menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

.nav__mobile-links {
  display: none;
}

/* ===== PAGE SECTIONS ===== */
.page-section {
  display: none;
  opacity: 0;
}

.page-section--active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s ease;
}

/* ===== BANNER ===== */
.banner {
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ===== MAIN CONTENT ===== */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ===== HOMEPAGE GRID ===== */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.post-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.post-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  animation: fadeInUp 0.6s ease both;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }

.post-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.post-card__accent {
  width: 8px;
  background: var(--accent);
  flex-shrink: 0;
}

.post-card__img {
  display: none;
}

.post-card__body {
  padding: 1.5rem 2rem;
  flex: 1;
}

.post-card--featured .post-card__body {
  padding: 2.5rem 2.5rem;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.post-card__date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.post-card__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-faint);
  padding: 2px 8px;
  border-radius: 2px;
}

.post-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.post-card--featured .post-card__title {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.post-card__excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.post-card--featured .post-card__excerpt {
  font-size: 1rem;
}

/* ===== ARTICLE PAGE ===== */
.article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 104px 1.5rem 6rem;
}

.article__header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-faint);
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 1.25rem;
}

.article__title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.article__meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article__meta-author {
  font-weight: 600;
  color: var(--text);
}

.article__meta-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.article__meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.article__hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 3rem;
  border-radius: 2px;
}

/* Article body typography */
.article__body h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.article__body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.article__body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

.article__body p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.article__body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article__body blockquote p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.article__body em {
  font-style: italic;
}

.article__body strong {
  font-weight: 700;
}

.article__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.article__body ul,
.article__body ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article__body li {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

/* ===== PROFILE CARD ===== */
.profile-card {
  background: #3A3A3A;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  animation: fadeInUp 0.6s ease 0.4s both;
  margin-top: 1rem;
}

.profile-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.profile-card__img {
  width: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2.5rem;
  position: relative;
}

.profile-card__accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
}

.profile-card__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.25rem;
}

.typewriter {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}

.typewriter--line1 {
  animation: typing1 1.5s steps(14, end) forwards;
}

.typewriter--line2 {
  animation: typing2 1.5s steps(13, end) 1.5s forwards;
}

@keyframes typing1 {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes typing2 {
  from { width: 0; }
  to { width: 100%; }
}

.profile-card__subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
  max-width: 500px;
}

.profile-card__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  max-width: 500px;
}

/* ===== CONTACT SECTION ===== */
.contact {
  background: #4A4A4A;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  margin-top: 64px;
}

.contact__inner {
  text-align: center;
  max-width: 600px;
}

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

.contact__link {
  display: block;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

.contact__link:nth-child(1) { animation-delay: 0.1s; }
.contact__link:nth-child(2) { animation-delay: 0.2s; }
.contact__link:nth-child(3) { animation-delay: 0.3s; }

.contact__link--btn {
  font: inherit;
  text-align: center;
  width: 100%;
  cursor: pointer;
}

.contact__link:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.contact__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.contact__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  transition: background 0.3s, border-color 0.3s;
}

.footer--dark {
  background: #4A4A4A;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.footer--dark .footer__text {
  color: rgba(255, 255, 255, 0.6);
}

.footer--dark .footer__brand {
  color: var(--accent);
}

.footer__text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.footer__brand {
  color: var(--accent);
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.back-link__arrow {
  font-size: 1rem;
  line-height: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav__left,
  .nav__right {
    min-width: auto;
  }

  .nav__left .nav__link,
  .nav__right .nav__link {
    display: none;
  }

  .nav__menu-btn {
    display: block;
  }

  .nav__mobile-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
  }

  .nav__mobile-links.active {
    display: flex;
  }

  .nav__mobile-links .nav__link {
    display: block;
    padding: 0.5rem 0;
  }

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

  .post-card--featured .post-card__title {
    font-size: 1.5rem;
  }

  .post-card--featured .post-card__img {
    aspect-ratio: 16 / 9;
  }

  .article__title {
    font-size: 2rem;
  }

  .main {
    padding: 1.5rem 1rem 3rem;
  }

  .post-card__body {
    padding: 1rem 1.25rem;
  }

  .post-card--featured .post-card__body {
    padding: 1.5rem;
  }

  .post-card__title {
    font-size: 1.1rem;
  }

  .post-card--featured .post-card__title {
    font-size: 1.25rem;
  }

  .post-card__excerpt {
    font-size: 0.85rem;
  }

  .profile-card__img {
    width: 100px;
  }

  .profile-card__content {
    padding: 1.25rem 1.5rem;
  }

  .profile-card__title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
  }

  .profile-card__desc {
    font-size: 0.85rem;
  }

  .nav__center {
    padding: 0.5rem 1.5rem;
    gap: 1.5rem;
  }

  .nav__tabs {
    gap: 1rem;
  }

  .nav__tab {
    font-size: 0.7rem;
  }

  .contact {
    padding: 2rem 1rem;
  }

  .contact__value {
    font-size: 1.2rem;
  }

  .article {
    padding: 88px 1rem 4rem;
  }
}

@media (max-width: 480px) {
  .nav__brand {
    font-size: 1rem;
    letter-spacing: 0.08em;
  }

  .article__title {
    font-size: 1.65rem;
  }

  .article__body p,
  .article__body li {
    font-size: 1rem;
  }
}
