@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=Fira+Code:wght@300;400;500&family=Lato:ital,wght@0,300;0,400;1,300&display=swap');

/*
  ===========================
  THEME TOKENS — DARK (default)
  ===========================
  Applied when: system is dark, OR [data-theme="dark"] is set manually.
*/

:root {
  --bg-base: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-2: #1c2330;
  --border-subtle: #21293a;
  --border-default: #2d3748;
  --border-strong: #4a5568;
  --text-primary: #e6edf3;
  --text-secondary: #b4bac0;
  --text-muted: #4a5568;
  --accent: #38bdf8;
  --accent-dim: #0e7490;
  --accent-glow: rgba(56, 189, 248, 0.12);
  --header-bg: rgba(13, 17, 23, 0.85);
  --grid-line: #21293a;

  /* Theme toggle icon */
  --toggle-icon: '☀';
}

/*
  ===========================
  THEME TOKENS — LIGHT
  ===========================
  Applied when: system is light, OR [data-theme="light"] is set manually.
  Manual always overrides system preference.
*/

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-base: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-surface-2: #eef1f5;
    --border-subtle: #dde2ea;
    --border-default: #c8cfd9;
    --border-strong: #9aa5b4;
    --text-primary: #0f1923;
    --text-secondary: #4a5568;
    --text-muted: #9aa5b4;
    --accent: #0369a1;
    --accent-dim: #0ea5e9;
    --accent-glow: rgba(3, 105, 161, 0.10);
    --header-bg: rgba(244, 246, 249, 0.88);
    --grid-line: #dde2ea;
    --toggle-icon: '☾';
  }
}

/* Manual override: light */
:root[data-theme="light"] {
  --bg-base: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-surface-2: #eef1f5;
  --border-subtle: #dde2ea;
  --border-default: #c8cfd9;
  --border-strong: #9aa5b4;
  --text-primary: #0f1923;
  --text-secondary: #313438;
  --text-muted: #9aa5b4;
  --accent: #0369a1;
  --accent-dim: #0ea5e9;
  --accent-glow: rgba(3, 105, 161, 0.10);
  --header-bg: rgba(244, 246, 249, 0.88);
  --grid-line: #dde2ea;
  --toggle-icon: '☾';
}

/* Manual override: dark */
:root[data-theme="dark"] {
  --bg-base: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-2: #1c2330;
  --border-subtle: #21293a;
  --border-default: #2d3748;
  --border-strong: #4a5568;
  --text-primary: #e6edf3;
  --text-secondary: #a2acb8;
  --text-muted: #4a5568;
  --accent: #38bdf8;
  --accent-dim: #0e7490;
  --accent-glow: rgba(56, 189, 248, 0.12);
  --header-bg: rgba(13, 17, 23, 0.85);
  --grid-line: #21293a;
  --toggle-icon: '☀';
}


/*
  ===========================
  STATIC TOKENS (theme-independent)
  ===========================
*/

:root {
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;
  --sp-7: 96px;

  --font-display: 'Syne', sans-serif;
  --font-body: 'Lato', sans-serif;
  --font-mono: 'Fira Code', monospace;

  --text-xs: clamp(0.875rem, 0.84rem + 0.16vw, 0.9375rem);
  --text-sm: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --text-base: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --text-md: clamp(1.35rem, 1.28rem + 0.34vw, 1.5rem);
  --text-lg: clamp(1.6rem, 1.5rem + 0.5vw, 1.875rem);
  --text-xl: clamp(2rem, 1.85rem + 0.75vw, 2.5rem);
  --text-2xl: clamp(2.5rem, 2.2rem + 1.4vw, 3.25rem);
  --text-3xl: clamp(3rem, 2.6rem + 2vw, 4.25rem);
  --text-4xl: clamp(3.5rem, 3rem + 2.5vw, 5.25rem);

  --radius: 6px;
  --radius-lg: 10px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


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

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

html {
  scroll-behavior: smooth;
  /* Smooth theme transition on manual toggle */
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  background-color: var(--bg-base);
  color: var(--text-secondary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;

  /* background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); */
  background-size: 40px 40px;
  background-attachment: fixed;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}


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

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

@media (max-width: 600px) {
  .container {
    padding: 0 var(--sp-3);
  }
}


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

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
}

.logo {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.logo::after {
  content: '_';
  animation: blink 1.1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Right side of header: theme toggle + lang switch */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 40px;
  height: 40px;
  background: var(--header-bg);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-base);
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.theme-toggle .icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.theme-toggle:hover {
  background: var(--bg-surface);
  color: var(--accent);
}

/* Default: assume light system */
.icon-sun {
  display: none;
}

.icon-moon {
  display: inline;
}

/* System preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: inline;
  }

  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

/* Manual overrides */
:root[data-theme="dark"] .icon-sun {
  display: inline;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="light"] .icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-moon {
  display: inline;
}

.lang-switch a {
  display: flex;
  align-items: center;
  opacity: 0.55;
  transition: opacity var(--transition);
}

.lang-switch a:hover {
  opacity: 1;
}

.lang-switch svg {
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border-default);
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-7) 0 var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeUp 0.6s ease both;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.hero-name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-role {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: var(--sp-1);
}

.hero-role::before {
  content: '// ';
  color: var(--text-muted);
}

.hero-subtitle {
  font-size: var(--text-md);
  color: var(--text-primary);
  font-weight: 300;
  line-height: 1.5;
}

.hero-text p:not(.hero-subtitle) {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.hero-image {
  flex-shrink: 0;
  animation: fadeIn 0.8s ease both 0.25s;
}

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

.hero-image img {
  height: 100%;
  width: auto;
  max-height: 160px;
  border-radius: var(--radius);
  object-fit: cover;
}

/*
  ===========================
  SECTIONS
  ===========================
*/

section {
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeUp 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 100ms);
}

section:last-of-type {
  border-bottom: none;
}

section h2 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

section h2::before {
  content: attr(data-index);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.08em;
  opacity: 0.7;
  flex-shrink: 0;
  position: relative;
  top: -2px;
}

section>p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.8;
}


/*
  ===========================
  LIST
  ===========================
*/

.list {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.list li {
  position: relative;
  padding-left: var(--sp-3);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}

.list li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 300;
  line-height: 1.7;
}

/*
  ===========================
  CARDS
  ===========================
*/

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  position: relative;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--sp-4);
  right: var(--sp-4);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

/* .card:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-2);
  box-shadow: 0 0 24px var(--accent-glow);
}

.card:hover::before {
  opacity: 1;
} */

.card h3 {
  font-family: var(--font-body);
  font-size: var(--text-mg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card .subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  font-style: normal;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
  opacity: 0.85;
}

.card p:not(.subtitle) {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.75;
}

.card p+p {
  margin-top: var(--sp-2);
}


/*
  ===========================
  CONTACT
  ===========================
*/

#contact .email {
  margin-top: var(--sp-3);
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 3px 10px;
  display: inline-block;
  margin-top: 4px;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

#contact .email:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  cursor: default;
}


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

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-4) 0;
  text-align: center;
  background: transparent;
}

.footer .container {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.footer .privacy-link {
  white-space: nowrap;
}

/*
  ===========================
  ANIMATIONS
  ===========================
*/

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


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

@media (max-width: 680px) {
  .header-inner {
    padding: var(--sp-1) var(--sp-2);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
    padding-top: var(--sp-5);
    text-align: center;
  }

  .hero-image {
    order: -1;
    display: flex;
    justify-content: center;
  }

  .hero-image img {
    width: 100px;
    height: 100px;
  }

  .hero-role::before {
    display: none;
  }

  section {
    padding: var(--sp-4) 0;
  }

  .footer {

    padding: var(--sp-2) 0;
  }

  .footer .separator {
    display: none;
  }

  .privacy-link {
    flex-basis: 100%;
    /* forces new line */
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}