/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #F6F4EE;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #FBF9F4;
  --line: #E1DDD1;
  --line-soft: #EAE6DA;
  --text: #21262F;
  --text-muted: #5C6470;
  --text-faint: #8B94A0;
  --accent: #BD7A2C;      /* brass / warm amber */
  --accent-soft: #F3E5CC;
  --accent-2: #2C8C7E;    /* deep teal */
  --accent-2-soft: #E1F1EC;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --maxw: 1080px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: var(--font-mono); color: var(--accent); background: var(--bg-panel-2); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.85em; }

.mono { font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* subtle grain overlay for texture */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.02;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
main > section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 32px;
}

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head__icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 10px;
  font-weight: 600;
}
.section-sub { color: var(--text-muted); margin: 0; font-size: 1rem; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  max-width: var(--maxw);
  margin: 0 auto;
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(246,244,238,0.92), rgba(246,244,238,0));
}
.topbar__mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}
.topbar__mark .dot { color: var(--accent); }
.topbar__nav { display: flex; gap: 28px; }
.topbar__nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}
.topbar__nav a:hover { color: var(--text); }

@media (max-width: 640px) {
  .topbar__nav { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding-top: 120px !important;
  padding-bottom: 110px !important;
  overflow: hidden;
}
.hero__grid {
  position: absolute;
  inset: -20% -10%;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 30% 20%, black, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 60% at 30% 20%, black, transparent 72%);
  opacity: 0.8;
  animation: drift 40s linear infinite;
}
@keyframes drift {
  from { transform: translate(0,0); }
  to { transform: translate(56px, 56px); }
}
.hero__inner { position: relative; }

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-2);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  background: var(--accent-2-soft);
  border: 1px solid rgba(44,140,126,0.25);
  padding: 7px 14px;
  border-radius: 999px;
  margin: 0 0 28px;
  flex-wrap: wrap;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(44,140,126,0.6);
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(44,140,126,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(44,140,126,0); }
  100% { box-shadow: 0 0 0 0 rgba(44,140,126,0); }
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--accent);
  margin: 0 0 22px;
  font-weight: 500;
}
.hero__desc {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 40px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #FFFFFF; }
.btn--primary:hover { background: #A8691F; }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--full { width: 100%; }
.btn .icon { width: 18px; height: 18px; }

/* ==========================================================================
   Experience log
   ========================================================================== */
.log { border-top: 1px solid var(--line-soft); }

.log__list { position: relative; }

.entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  padding-bottom: 40px;
}
.entry--last { padding-bottom: 0; }

.entry__rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.entry__line {
  flex: 1;
  width: 1px;
  background: var(--line);
  margin-left: 8px;
  min-height: 40px;
}
.entry__tag {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 4px;
  color: var(--text-faint);
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
}
.entry__tag--active {
  color: #FFFFFF;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.entry__body {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: 0 1px 2px rgba(33,38,47,0.04);
}
.entry--active .entry__body { border-color: rgba(44,140,126,0.35); }

.entry__meta {
  font-size: 0.68rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}
.entry__role {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 4px;
  font-weight: 600;
}
.entry__org {
  color: var(--accent);
  font-size: 0.92rem;
  margin: 0 0 12px;
  font-weight: 500;
}
.entry__desc { color: var(--text-muted); margin: 0; font-size: 0.96rem; }

@media (max-width: 640px) {
  .entry { grid-template-columns: 1fr; gap: 12px; }
  .entry__rail { flex-direction: row; align-items: center; }
  .entry__line { display: none; }
}

/* ==========================================================================
   Skills / expertise
   ========================================================================== */
.skills { border-top: 1px solid var(--line-soft); }
.skills__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.skills__grid li {
  background: var(--bg-panel);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.skills__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}
.skills__label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: middle;
}
.skills__sub { color: var(--text-muted); font-size: 0.86rem; }

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

/* ==========================================================================
   Education
   ========================================================================== */
.education { border-top: 1px solid var(--line-soft); }
.edu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}
.edu-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.edu-item__degree {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
.edu-item__meta {
  color: var(--text-faint);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ==========================================================================
   Offline / Hobbies
   ========================================================================== */
.offline { border-top: 1px solid var(--line-soft); }
.offline__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.offline-card {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(33,38,47,0.04);
}
.offline-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(33,38,47,0.08);
}
.offline-card__photo {
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: center 30%;
  border-bottom: 1px solid var(--line-soft);
}
.offline-card__body { padding: 22px; }
.offline-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 8px;
  font-weight: 600;
}
.offline-card p { color: var(--text-muted); margin: 0; font-size: 0.92rem; }

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

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { border-top: 1px solid var(--line-soft); padding-bottom: 60px !important; }
.section-sub a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.contact-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 24px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(33,38,47,0.04);
}
.contact-linkedin:hover { border-color: var(--accent); transform: translateY(-1px); }
.contact-linkedin .icon { width: 26px; height: 26px; color: var(--accent); flex: none; }
.contact-linkedin strong { display: block; font-size: 0.95rem; }
.contact-linkedin small { color: var(--text-faint); font-size: 0.8rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 0.8rem;
}
.footer a { text-decoration: none; color: var(--text-muted); }
.footer a:hover { color: var(--accent); }
