@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --font: "IBM Plex Mono", monospace;
  --spacing: 4px;
  --body-padding: 40px;
  --max-width: 1800px;
  --card-margin: 60px;
  --transition-theme: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, fill 0.35s ease, box-shadow 0.35s ease;
}

html.dark {
  color-scheme: dark;
  --accent: #6b9fff;
  --accent-on: #0a0a0b;
  --accent-soft: rgba(107, 159, 255, 0.1);
  --accent-glow: rgba(107, 159, 255, 0.25);
  --body-bg: #0a0a0b;
  --section-bg: #131416;
  --section-fg: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #888888;
  --text-body: #cccccc;
  --text-faint: #666666;
  --text-tag: #dddddd;
  --text-timeline: #999999;
  --border-color: #ffffff1f;
  --surface-subtle: #ffffff0a;
  --surface-muted: #ffffff05;
  --surface-hover: #ffffff08;
  --pattern-dot: #ffffff10;
  --pattern-stripe: #ffffff08;
  --icon-stroke: #ffffff;
  --toggle-track: #1e2128;
  --toggle-thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

html.light {
  color-scheme: light;
  --accent: #2563eb;
  --accent-on: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.2);
  --body-bg: #f4f5f7;
  --section-bg: #ffffff;
  --section-fg: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-body: #334155;
  --text-faint: #94a3b8;
  --text-tag: #1e293b;
  --text-timeline: #64748b;
  --border-color: #0f172a14;
  --surface-subtle: #0f172a08;
  --surface-muted: #0f172a05;
  --surface-hover: #0f172a06;
  --pattern-dot: #0f172a12;
  --pattern-stripe: #0f172a08;
  --icon-stroke: #0f172a;
  --toggle-track: #e2e8f0;
  --toggle-thumb-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
}

/* Legacy alias */
:root {
  --logo: var(--accent);
}

@media (max-width: 600px) {
  :root { --body-padding: 20px; --card-margin: 24px; }
}

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

html { min-height: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--body-bg);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: var(--transition-theme);
}

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

/* ── HEADER ── */
.app-header {
  width: 100%;
  max-width: var(--max-width);
  z-index: 50;
  background: var(--body-bg);
  text-transform: uppercase;
  height: 72px;
  padding: 0 var(--body-padding);
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  transition: var(--transition-theme);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}

.header-left a {
  height: 100%;
  color: var(--accent);
  align-items: center;
  transition: color .2s ease-out;
  display: inline-flex;
  position: relative;
}

.header-left a::after {
  content: "";
  background-color: var(--accent);
  width: 0;
  height: 2px;
  transition: width .2s linear;
  position: absolute;
  bottom: 22px;
  left: 0;
}

.header-left a:not(.logo-link):hover::after,
.header-left a:not(.logo-link).active::after {
  width: 100%;
}

.header-left a.logo-link::after {
  display: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--accent);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.35s ease, box-shadow 0.2s ease;
}

.logo-link:hover .logo-mark,
.logo-link:focus-visible .logo-mark {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: 0 0 0 1px var(--section-bg), 0 0 0 2px var(--accent);
}

.logo-mark--footer {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.footer-logo-link {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 4px;
}

.footer-logo-link::after {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.header-right a {
  height: 100%;
  color: var(--accent);
  align-items: center;
  display: inline-flex;
}

.header-right a.contact-button {
  align-self: center;
  height: 32px;
  padding: 0 14px;
  line-height: 1;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: var(--accent-on) !important;
  border-radius: 16px;
  font-weight: 700;
  transition: all .2s ease-out;
}

.header-right a.contact-button:hover {
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px var(--accent);
  background-color: transparent;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:focus-visible .theme-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle-track {
  display: block;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  background: var(--toggle-track);
  border: 1px solid var(--border-color);
  position: relative;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.theme-toggle-icons {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  pointer-events: none;
}

.theme-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: color 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

html.dark .theme-icon-moon {
  color: var(--accent);
  opacity: 1;
  transform: scale(1.05);
}

html.dark .theme-icon-sun {
  opacity: 0.45;
}

html.light .theme-icon-sun {
  color: var(--accent);
  opacity: 1;
  transform: scale(1.05);
}

html.light .theme-icon-moon {
  opacity: 0.45;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--section-bg), var(--body-bg));
  border: 1px solid var(--border-color);
  box-shadow: var(--toggle-thumb-shadow);
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.35s ease, border-color 0.35s ease;
}

html.light .theme-toggle-thumb {
  transform: translateX(26px);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
}

html.dark .theme-toggle-thumb {
  background: linear-gradient(145deg, #2a2f3a, #1a1d24);
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  padding-top: 72px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 80px 1fr 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--section-bg);
  background-image: radial-gradient(circle at 1px 1px, var(--pattern-dot) 0.6px, transparent 0);
  background-size: 20px 20px;
  z-index: -1;
  transition: var(--transition-theme);
}

.hero-top-1 {
  color: var(--text-primary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  grid-area: 1 / 1;
  align-items: flex-end;
  height: 80px;
  padding: 20px var(--body-padding) 14px;
  font-size: 12px;
  display: flex;
}

.hero-top-2 {
  color: var(--text-primary);
  text-align: right;
  text-transform: uppercase;
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  grid-area: 1 / 2;
  justify-content: flex-end;
  align-items: flex-end;
  height: 80px;
  padding: 20px var(--body-padding) 14px;
  font-size: 12px;
  display: flex;
}

.hero-flex-1 {
  grid-area: 2 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px;
}

.hero-flex-2 {
  border-left: 1px solid var(--border-color);
  flex-direction: column;
  grid-area: 2 / 2;
  justify-content: center;
  gap: 40px;
  padding: 0 0 0 40px;
  display: flex;
  position: relative;
}

.hero-bottom-1 {
  color: var(--accent);
  text-transform: uppercase;
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  grid-area: 3 / 2;
  align-items: center;
  height: 64px;
  padding: 0 var(--body-padding);
  display: flex;
  font-size: 12px;
  font-weight: 500;
}

.hero-bottom-2 {
  border-top: 1px solid var(--border-color);
  grid-area: 3 / 1;
  height: 64px;
}

.hero h1 {
  font-family: var(--font);
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  position: relative;
}

.hero h1 .highlight-word {
  background-color: var(--accent);
  color: var(--accent-on);
  box-shadow: 0 0 0 2px var(--section-bg), 0 0 0 3px var(--accent);
  padding: 0 12px 2px;
  display: inline-block;
  margin-left: 3px;
}

.hero .description {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  max-width: 500px;
}

.hero-button {
  background-color: var(--accent);
  height: 52px;
  border-radius: 26px;
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s ease-out;
}

.hero-button-text {
  color: var(--section-bg);
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.hero-button:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
  background-color: transparent;
}

.hero-button:hover .hero-button-text {
  color: var(--accent);
}

.hero-button:hover .hero-button-text svg {
  stroke: var(--accent);
}

.hero-button-text svg {
  width: 20px;
  height: 20px;
  stroke: var(--section-bg);
  stroke-width: 2;
}

/* ── BANNER SCROLL ── */
.banner {
  background-color: var(--accent);
  height: 32px;
  color: var(--accent-on);
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  line-height: 32px;
  overflow: hidden;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.banner-scroll {
  display: inline-block;
  animation: banner-scroll 20s linear infinite;
}

@keyframes banner-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── PROFILE PHOTO AREA ── */
.profile-photo-wrap {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
  animation: pulse-glow 3s ease-in-out infinite;
  flex-shrink: 0;
}

.profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transition: opacity 0.4s ease;
}

html.dark .profile-photo--light,
html.light .profile-photo--dark {
  opacity: 0;
}

html.dark .profile-photo--dark,
html.light .profile-photo--light {
  opacity: 1;
}

.profile-photo-wrap::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: pulse-ring 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow), 0 0 60px var(--accent-soft); }
  50% { box-shadow: 0 0 30px var(--accent-glow), 0 0 80px var(--accent-soft); }
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.05); opacity: 0.15; }
}

/* ── METADATA TAG ── */
.metadata {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
}

.globe-icon {
  color: var(--accent);
}

.globe-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
}

/* ── PITCH / SCROLL TEXT ── */
.pitch {
  padding: 120px var(--body-padding);
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pitch-content {
  font-family: var(--font);
  text-transform: uppercase;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  max-width: 1000px;
  color: var(--text-primary);
}

.pitch-content .word {
  display: inline-block;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.pitch-content .word.visible {
  opacity: 1;
}

/* ── CARD STACK SECTIONS ── */
.card-stack-section {
  padding: 0 var(--body-padding);
  margin-bottom: 40px;
}

.card-item {
  background-color: var(--section-bg);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 40px;
  transition: var(--transition-theme);
}

.card-item .section-content {
  display: flex;
  min-height: 500px;
  position: relative;
}

.card-item .flex-content {
  flex: 1;
  padding: var(--card-margin);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.card-item .flex-content.art-side {
  border-left: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-item h3 {
  font-family: var(--font);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
  color: var(--text-primary);
  font-weight: 700;
}

.card-item p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.card-item p span {
  background: var(--accent);
  color: var(--accent-on);
  text-transform: uppercase;
  padding: 0 4px 1px;
  font-size: 14px;
  font-weight: 700;
}

/* ── FEATURE LIST (TAGS) ── */
.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-list .tag {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-tag);
  transition: all .2s ease;
}

.feature-list .tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── CARD FOOTER ── */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.footer-tag {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
}

.metadata-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metadata-icons svg {
  width: 24px;
  height: 24px;
  stroke: var(--icon-stroke);
  fill: none;
}

/* ── TIMELINE ── */
.timeline-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  min-width: 120px;
  padding-top: 4px;
}

.timeline-content h4 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.timeline-content .org {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 8px;
}

.timeline-content p {
  color: var(--text-timeline);
  font-size: 13px;
  line-height: 1.6;
}

/* ── SKILLS GRID ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  transition: all .3s ease;
}

.skill-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.skill-card .skill-title {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.skill-card .skill-items {
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.8;
}

/* ── PORTFOLIO LINKS ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.portfolio-link {
  background: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all .2s ease;
  cursor: pointer;
}

.portfolio-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.portfolio-link .link-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.portfolio-link svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
}

/* ── CONTACT SECTION ── */
.contact-section {
  padding: 80px var(--body-padding);
  text-align: center;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.contact-item {
  background: var(--section-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .2s ease;
}

.contact-item:hover {
  border-color: var(--accent);
}

.contact-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
}

.contact-item .contact-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-item .contact-value {
  color: var(--text-primary);
  font-size: 14px;
}

/* ── FOOTER ── */
.footer-section {
  padding: 80px var(--body-padding) 40px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-section .tagline {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 16px;
}

.footer-section .copyright {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 24px;
}

.footer-header {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: color .2s;
}

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

/* ── CROP MARKS ── */
.crop-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.crop-marks .crop {
  position: absolute;
  width: 16px;
  height: 16px;
}

.crop-marks .crop:nth-child(1) { top: 8px; left: 8px; border-top: 1px solid var(--border-color); border-left: 1px solid var(--border-color); }
.crop-marks .crop:nth-child(2) { top: 8px; right: 8px; border-top: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }
.crop-marks .crop:nth-child(3) { bottom: 8px; left: 8px; border-bottom: 1px solid var(--border-color); border-left: 1px solid var(--border-color); }
.crop-marks .crop:nth-child(4) { bottom: 8px; right: 8px; border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }

/* ── ART DECORATIONS ── */
.stripes-bg {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    var(--pattern-stripe) 4px,
    var(--pattern-stripe) 5px
  );
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}

.dot-grid {
  background-color: transparent;
  background-image: radial-gradient(circle at 1px 1px, var(--pattern-dot) 0.6px, transparent 0);
  background-size: 20px 20px;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: 80px auto auto 64px;
  }
  .hero-top-2 { display: none; }
  .hero-flex-1 { grid-area: 2 / 1; padding: 40px 20px; }
  .hero-flex-2 { grid-area: 3 / 1; border-left: none; padding: 40px var(--body-padding) 80px; }
  .hero-bottom-1 { grid-area: 4 / 1; border-left: none; }
  .hero-bottom-2 { display: none; }
  .hero h1 { font-size: 36px; }
  .card-item .section-content { flex-direction: column; }
  .card-item .flex-content.art-side { border-left: none; border-top: 1px solid var(--border-color); min-height: 300px; }
  .footer-content { flex-direction: column; }
  .app-header { font-size: 12px; }
  .header-left { gap: 16px; }
}

@media (max-width: 600px) {
  .header-right { gap: 12px; }
  .theme-toggle-track { width: 50px; height: 28px; }
  .theme-toggle-thumb { width: 20px; height: 20px; }
  html.light .theme-toggle-thumb { transform: translateX(22px); }
  .hero h1 { font-size: 28px; }
  .hero h1 .highlight-word { font-size: 28px; }
  .profile-photo-wrap { width: 200px; height: 200px; }
  .skills-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .contact-grid { flex-direction: column; align-items: stretch; }
  .timeline-item { flex-direction: column; gap: 8px; }
  .timeline-date { min-width: auto; }
}

/* ── SCROLL ANIMATIONS ── */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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