/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --bg:          #F5F0E8;
  --bg-card:     #FFFFFF;
  --bg-alt:      #EDE7DB;

  --text:        #2C2318;
  --text-muted:  #7A7060;
  --text-soft:   #A09080;

  --indigo:      #5448C8;
  --indigo-bg:   rgba(84, 72, 200, 0.08);
  --teal:        #0F766E;
  --teal-bg:     rgba(15, 118, 110, 0.08);
  --amber:       #B45309;
  --amber-bg:    rgba(180, 83, 9, 0.08);

  --border:      #DDD6C8;
  --border-mid:  #C8BFB0;

  --font-heading: 'Archivo', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;

  --radius:      10px;
  --nav-h:       64px;
  --section-pad: clamp(4.5rem, 9vw, 8rem);
  --container:   min(1120px, 100% - 3rem);

  /* Consistent type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.75rem;
  --text-4xl:  3.75rem;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: var(--container);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-pad);
}

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

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  height: var(--nav-h);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 12px rgba(44, 35, 24, 0.06);
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: var(--text-base);
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-logo:hover { color: var(--indigo); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-links a:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ============================================
   HERO
   ============================================ */
#gol-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(84, 72, 200, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 0% 100%, rgba(15, 118, 110, 0.05) 0%, transparent 50%),
    var(--bg);
}

.hero-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: center;
  padding-block: 4rem;
}

/* LEFT */
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--indigo);
  flex-shrink: 0;
  animation: pulse 2.5s ease-in-out infinite;
}

.hero-meta-sep { color: var(--border-mid); }

.hero-location { color: var(--text-muted); }

.hero-name {
  font-size: clamp(var(--text-3xl), 6.5vw, var(--text-4xl));
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero-role {
  font-size: var(--text-md);
  color: var(--indigo);
  font-weight: 500;
}

.hero-bio {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 52ch;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  padding-top: 0.5rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.hero-link:hover {
  color: var(--indigo);
  border-color: var(--indigo);
  background: var(--indigo-bg);
  transform: translateY(-2px);
}

.hero-link:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}

/* RIGHT: Facts panel */
.hero-right {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.625rem;
}

.fact + .fact {
  border-top: 1px solid var(--border);
}

.fact-label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  font-family: var(--font-heading);
}

.fact-value {
  font-size: var(--text-sm);
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}

.fact-link {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 600;
}

.fact-link:hover { text-decoration: underline; }

.fact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.fact-tag {
  font-size: var(--text-xs);
  padding: 0.25rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}

/* ============================================
   NOW SECTION
   ============================================ */
.now-header {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.now-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 900;
  color: var(--text);
}

.now-updated {
  font-size: var(--text-xs);
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.now-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.now-list li {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
}

.now-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--indigo);
  font-weight: 600;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  flex-shrink: 0;
}

#about   .section-num { color: var(--indigo); }
#work    .section-num { color: var(--teal);   }
#contact .section-num { color: var(--amber);  }

.section-header h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 900;
  color: var(--text);
}

/* ============================================
   SUBSECTION TITLE
   ============================================ */
.subsection-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0;
  font-family: var(--font-heading);
}

/* ============================================
   CAREER LIST
   ============================================ */
.career-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.career-row {
  display: grid;
  grid-template-columns: 200px 1fr 120px;
  gap: 1.5rem;
  align-items: start;
  padding: 1.625rem 0;
  border-bottom: 1px solid var(--border);
}

.career-row:first-child { border-top: 1px solid var(--border); }

.career-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.125rem;
}

.career-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.career-link:hover {
  border-bottom-color: currentColor;
}

.career-company {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

.career-role {
  font-size: var(--text-sm);
  color: var(--indigo);
  font-weight: 500;
}

.career-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

.career-period {
  font-size: var(--text-xs);
  color: var(--text-soft);
  text-align: right;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-top: 0.25rem;
}

/* ============================================
   PROJECT LIST
   ============================================ */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  padding: 1.875rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 4px;
}

.project-row:first-child {
  border-top: 1px solid var(--border);
}

.project-row:hover {
  background: var(--bg-card);
  padding-inline: 1rem;
  margin-inline: -1rem;
}

.project-row:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 4px;
}

.project-row-left {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.project-row-title {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
}

.project-idx {
  font-size: var(--text-xs);
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.project-row-title h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 56ch;
}

.project-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.875rem;
  padding-top: 0.125rem;
  flex-shrink: 0;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: flex-end;
}

.tech {
  font-size: var(--text-xs);
  font-family: monospace;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.project-actions {
  display: flex;
  gap: 0.625rem;
}

.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: color 0.2s;
  cursor: pointer;
}

.icon-link:hover { color: var(--indigo); }

.icon-link:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.85;
}

.about-text p + p { margin-top: 1.25rem; }

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

.tag-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag-label {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  font-family: var(--font-heading);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.3125rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.tag:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-bg);
}

.tag--accent {
  background: var(--teal-bg);
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--teal);
  font-weight: 500;
}

.tag--accent:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

a.tag {
  text-decoration: none;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-inner { max-width: 640px; }

.contact-text {
  font-size: var(--text-xl);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  padding: 0.5625rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.contact-link:hover {
  color: var(--indigo);
  border-color: var(--indigo);
  background: var(--indigo-bg);
  transform: translateY(-2px);
}

.contact-link:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}

/* ============================================
   INLINE LINK (used in about text)
   ============================================ */
.inline-link {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(84, 72, 200, 0.3);
  transition: border-color 0.2s;
}

.inline-link:hover { border-bottom-color: var(--indigo); }

code {
  font-family: monospace;
  font-size: 0.875em;
  background: var(--bg-alt);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding-block: 2rem;
  border-top: 1px solid var(--border);
}

.footer .container { display: flex; justify-content: center; }

.footer p {
  font-size: var(--text-xs);
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   HERO ENTRY ANIMATIONS
   ============================================ */
.hero-meta    { opacity: 0; animation: fadeUp 0.5s ease 0.1s forwards; }
.hero-name    { opacity: 0; animation: fadeUp 0.6s ease 0.2s forwards; }
.hero-role    { opacity: 0; animation: fadeUp 0.5s ease 0.3s forwards; }
.hero-bio     { opacity: 0; animation: fadeUp 0.5s ease 0.4s forwards; }
.hero-links   { opacity: 0; animation: fadeUp 0.5s ease 0.5s forwards; }
.hero-right   { opacity: 0; animation: fadeUp 0.6s ease 0.35s forwards; }

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes pulse {
  0%, 100% { opacity: 1;   }
  50%       { opacity: 0.3; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal { opacity: 1 !important; transform: none !important; }

  .hero-meta, .hero-name, .hero-role,
  .hero-bio, .hero-links, .hero-right {
    opacity: 1 !important;
    animation: none !important;
  }

  .status-dot { animation: none !important; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-right { max-width: 480px; }
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .nav-links  { gap: 1.25rem; }
  .hero       { align-items: flex-start; padding-top: calc(var(--nav-h) + 2rem); }

  .project-row { grid-template-columns: 1fr; }
  .project-row-right { flex-direction: row; align-items: center; }
  .project-tech { justify-content: flex-start; }

  .career-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .career-period { text-align: left; }
}

@media (max-width: 520px) {
  .nav-links a    { font-size: var(--text-xs); }
  .contact-links  { gap: 0.5rem; }
}

/* ============================================
   HERO CHARACTER
   ============================================ */
.hero-character {
  position: fixed;
  bottom: -20px;
  right: -30px;
  width: 220px;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 50;
  transform: translateX(120%);
}

.hero-character img {
  width: 100%;
  display: block;
}

.hero-character.visible {
  animation: characterSlideIn 0.6s ease-out forwards;
}

@keyframes characterSlideIn {
  from { transform: translateX(120%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-character.visible { animation: none; transform: translateX(0); }
}

@media (max-width: 900px) {
  .hero-character { display: none; }
}

/* ============================================
   BLOG — INDEX
   ============================================ */
.blog-index-list {
  display: flex;
  flex-direction: column;
}

.blog-index-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 1.5rem;
  align-items: start;
  padding: 1.625rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s, padding 0.2s;
  border-radius: 4px;
}

.blog-index-row:first-child { border-top: 1px solid var(--border); }

.blog-index-row:hover {
  background: var(--bg-card);
  padding-inline: 1rem;
  margin-inline: -1rem;
}

.blog-index-row:hover .blog-index-title { color: var(--indigo); }

.blog-index-row:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 4px;
}

.blog-index-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-index-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.blog-index-excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 56ch;
}

.blog-index-date {
  font-size: var(--text-xs);
  color: var(--text-soft);
  text-align: right;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-top: 0.2rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .blog-index-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .blog-index-date { text-align: left; }
}

/* ============================================
   BLOG — POST
   ============================================ */
.blog-post {
  max-width: 680px;
  margin-inline: auto;
  padding-block: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(5rem, 10vw, 9rem);
}

.blog-post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-sm);
  color: var(--text-soft);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.2s;
}

.blog-post-back:hover { color: var(--indigo); }

.blog-post-date {
  font-size: var(--text-sm);
  color: var(--text-soft);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.blog-post-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.blog-post-body {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.85;
}

.blog-post-body p { margin-bottom: 1.25rem; }

.blog-post-body p:last-child { margin-bottom: 0; }

.blog-post-body b, .blog-post-body strong {
  font-weight: 600;
  color: var(--text);
}

.blog-post-body i, .blog-post-body em {
  font-style: italic;
}

.blog-post-body a {
  color: var(--indigo);
  text-decoration: none;
  border-bottom: 1px solid rgba(84, 72, 200, 0.3);
  transition: border-color 0.2s;
}

.blog-post-body a:hover { border-bottom-color: var(--indigo); }

.blog-post-body ol,
.blog-post-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-post-body li { color: var(--text-muted); }

.blog-post-body hr,
.blog-post-body p:has(> i:only-child) {
  color: var(--border-mid);
}

@media (max-width: 768px) {
  .blog-post,
  .blog-index {
    padding-inline: 1.5rem;
  }
}
