/* =====================================
   RESET & BASE
   ===================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* =====================================
   DESIGN SYSTEM
   ===================================== */

:root {
  /* Light mode */
  --bg: #f6f4ef;
  --bg-alt: #ebe8e1;
  --surface: #ffffff;

  --text: #1b1b1b;
  --muted: #5a5a5a;
  --line: #e2e0db;
  --accent: #1c3d5a;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --max: 1120px;

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

body.dark {
  --bg: #0f1115;
  --bg-alt: #161a21;
  --surface: #1b1f27;

  --text: #e8e6e3;
  --muted: #a3a3a3;
  --line: #23262d;
  --accent: #7aa2f7;
}

/* =====================================
   TYPOGRAPHY
   ===================================== */

h1,
h2,
h3 {
  font-family: var(--font-serif);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 64px;
  line-height: 1.1;
}

h2 {
  font-size: 36px;
  margin-bottom: 48px;
}

h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

p {
  margin: 0 0 16px;
}

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

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

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

/* =====================================
   LAYOUT
   ===================================== */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 160px 24px;
  background: var(--bg);
}

.section--alt {
  background: var(--bg-alt);
}

.section .container {
  max-width: 1100px;
}

.section .container p {
  max-width: 720px;
}

/* =====================================
   HEADER
   ===================================== */

.header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle,
.lang-toggle {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.theme-toggle {
  width: 40px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0 14px;
}

.theme-toggle:hover,
.lang-toggle:hover {
  border-color: var(--accent);
}

/* =====================================
   COMMON COMPONENTS
   ===================================== */

.card,
.project,
.article-item,
.featured-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card {
  box-shadow: var(--shadow);
  padding: 20px;
}

.project,
.article-item,
.featured-item {
  padding: 16px;
}

.article-item img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.skill,
.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}

.side-links a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.side-links a:hover {
  border-color: var(--accent);
}

/* =====================================
   HERO
   ===================================== */

.hero-grid {
  display: grid;
  grid-template-columns: 60% 40%;
  align-items: center;
  gap: 80px;
}

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

.hero-text h1 {
  font-size: 72px;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-text p {
  font-size: 18px;
}

.hero-image {
  display: flex;
  justify-content: flex-end;
}

.hero-image img {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* =====================================
   ABOUT
   ===================================== */

.about-grid {
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: center;
  gap: 80px;
}

.about-image {
  display: flex;
  justify-content: flex-start;
}

.about-image img {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 12px;
}

.about-text {
  max-width: 640px;
}

/* =====================================
   EXPERIENCE
   ===================================== */

.experience-group h3 {
  margin-bottom: 32px;
}

.company-header {
  margin-bottom: 48px;
}

.company-logo {
  height: 36px;
  width: auto;
  display: block;
  filter: grayscale(100%);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.company-logo:hover {
  opacity: 1;
}

.experience-role {
  margin-bottom: 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.role-toggle {
  all: unset;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  gap: 24px;
}

.role-toggle::after {
  content: "＋";
  font-size: 20px;
  transition: transform 0.3s ease;
}

.experience-role.active .role-toggle::after {
  transform: rotate(45deg);
}

.role-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height 0.45s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.experience-role.active .role-content {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 16px;
}

.role-content ul {
  padding-left: 20px;
  margin: 0;
}

/* =====================================
   PREVIOUS EXPERIENCE
   ===================================== */

.previous-section {
  margin-top: 120px;
}

.previous-title {
  margin-bottom: 48px;
  font-family: var(--font-serif);
}

.previous-logos {
  display: flex;
  gap: 80px;
  align-items: center;
}

.previous-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
}

.previous-item img {
  height: 36px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.previous-item:hover img {
  opacity: 1;
  transform: translateY(-4px);
}

.previous-overlay {
  margin-top: 16px;
  max-width: 260px;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.35;
  color: var(--text);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.previous-item:hover .previous-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================
   ARTICLE DISCOVERY / HOME
   ===================================== */

.articles-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.article-item + .article-item {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.article-item--featured {
  grid-row: span 2;
  padding: 2rem;
}

.article-category {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.articles-cta {
  margin-top: 2rem;
}

.cta {
  font-weight: 600;
}

/* =====================================
   ARTICLE PAGE
   ===================================== */

.article-body {
  display: grid;
  gap: 1rem;
}

.article-body h2 {
  margin-top: 1.5rem;
}

.article-body p,
.article-body ul,
.article-body ol {
  max-width: 70ch;
}

.article-body ul,
.article-body ol {
  padding-left: 1.25rem;
}

/* =====================================
   ARTICLE FEEDBACK
   ===================================== */

.article-feedback {
  margin-top: 4rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-feedback h2 {
  margin-bottom: 0.75rem;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.feedback-actions button {
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.feedback-actions button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.feedback-actions button.is-selected {
  border-color: var(--accent);
  background: var(--bg-alt);
}

.feedback-actions button:disabled {
  opacity: 0.75;
  cursor: default;
}

.feedback-message {
  margin-top: 1rem;
  color: var(--muted);
}

/* =====================================
   FOOTER
   ===================================== */

.footer {
  padding: 60px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* =====================================
   UTILITIES
   ===================================== */

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

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

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================
   RESPONSIVE
   ===================================== */

@media (max-width: 900px) {
  .section {
    padding: 96px 20px;
  }

  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image,
  .about-image {
    justify-content: center;
    margin-top: 40px;
  }

  .about-image {
    margin-bottom: 40px;
  }

  .hero-image img,
  .about-image img {
    max-width: 260px;
  }

  .previous-logos {
    flex-direction: column;
    gap: 40px;
    align-items: flex-start;
  }

  .previous-overlay {
    position: static;
    width: auto;
    margin-top: 12px;
  }
}

@media (max-width: 800px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-item--featured {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 30px;
    margin-bottom: 32px;
  }

  .container {
    padding: 0 20px;
  }

  .article-feedback {
    padding: 1.25rem;
  }

  .feedback-actions {
    flex-direction: column;
  }

  .feedback-actions button {
    width: 100%;
    text-align: left;
  }
}
