/* ==========================================================================
   1. Theme Tokens
   ========================================================================== */

:root {
  --color-bg-light: #f5f6f8;
  --color-bg-dark: #0f0f14;
  --color-primary: #7b2cff;
  --color-primary-dark: #4b00a8;
  --color-text-light: #1a1a1a;
  --color-text-dark: #ffffff;
  --color-muted: #9aa0a6;
  --color-card: #ffffff;
  --color-card-dark: #1a1a22;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
  color-scheme: dark;
  --bg: var(--color-bg-dark);
  --bg-elevated: rgba(24, 24, 32, 0.88);
  --bg-soft: rgba(255, 255, 255, 0.05);
  --panel: rgba(26, 26, 34, 0.96);
  --panel-strong: #241c34;
  --text: var(--color-text-dark);
  --muted: #b5bac2;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: var(--color-primary);
  --accent-strong: #cfb4ff;
  --accent-ink: #ffffff;
  --success: #7ddeaa;
  --danger: #ff9e96;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.28);
  --shadow-md: var(--shadow-soft);
  --shadow-sm: 0 8px 20px rgba(2, 11, 18, 0.16);
  --radius-xl: 2rem;
  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --radius-sm: 0.875rem;
  --max-width: 1180px;
  --header-offset: 5.75rem;
  --surface-glass: rgba(20, 20, 28, 0.82);
  --surface-card: linear-gradient(180deg, rgba(29, 29, 39, 0.96), rgba(16, 16, 22, 0.98));
  --surface-muted: linear-gradient(180deg, rgba(25, 25, 35, 0.92), rgba(14, 14, 20, 0.98));
  --surface-contact: linear-gradient(180deg, rgba(31, 31, 43, 0.96), rgba(19, 19, 26, 0.98));
  --field-bg: rgba(255, 255, 255, 0.05);
  --step--1: clamp(0.88rem, 0.84rem + 0.18vw, 0.96rem);
  --step-0: clamp(1rem, 0.96rem + 0.28vw, 1.12rem);
  --step-1: clamp(1.18rem, 1.06rem + 0.55vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.22rem + 1vw, 2rem);
  --step-3: clamp(1.95rem, 1.48rem + 1.8vw, 3rem);
  --step-4: clamp(2.65rem, 2.15rem + 2.8vw, 4.3rem);
  --section-space: clamp(3.25rem, 2.7rem + 2vw, 5rem);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: var(--color-bg-light);
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --bg-soft: rgba(255, 255, 255, 0.86);
  --panel: var(--color-card);
  --panel-strong: #ede7fb;
  --text: var(--color-text-light);
  --muted: #616874;
  --line: rgba(26, 26, 26, 0.1);
  --line-strong: rgba(26, 26, 26, 0.16);
  --accent: var(--color-primary);
  --accent-strong: var(--color-primary-dark);
  --accent-ink: #ffffff;
  --shadow-lg: 0 24px 60px rgba(43, 24, 73, 0.12);
  --shadow-md: 0 10px 30px rgba(43, 24, 73, 0.08);
  --shadow-sm: 0 8px 18px rgba(43, 24, 73, 0.06);
  --surface-glass: rgba(255, 255, 255, 0.8);
  --surface-card: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 252, 0.98));
  --surface-muted: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 239, 250, 0.96));
  --surface-contact: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 243, 250, 0.96));
  --field-bg: rgba(255, 255, 255, 0.92);
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

h1,
h2,
h3,
p {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: "Manrope", sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(123, 44, 255, 0.14), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(123, 44, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #0f0f14 0%, #12121a 48%, #171720 100%);
  transition:
    background 220ms ease,
    color 220ms ease,
    opacity 220ms ease;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(123, 44, 255, 0.08), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(123, 44, 255, 0.06), transparent 22%),
    linear-gradient(180deg, #f8f8fb 0%, #f5f6f8 48%, #eceef3 100%);
}

body:not(.is-loaded) {
  overflow: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  color: #ffffff;
  background: rgba(123, 44, 255, 0.72);
}

html[data-theme="light"] ::selection {
  color: #ffffff;
  background: rgba(123, 44, 255, 0.72);
}

:focus-visible {
  outline: 3px solid rgba(123, 44, 255, 0.34);
  outline-offset: 4px;
}

main section[id] {
  scroll-margin-top: calc(var(--header-offset) + 1rem);
}

.page-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

/* ==========================================================================
   3. Loader, Reveal, Cursor, Floating Actions
   ========================================================================== */

.page-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 15, 20, 0.76);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: opacity 420ms ease, visibility 420ms ease;
}

html[data-theme="light"] .page-loader {
  background: rgba(245, 246, 248, 0.86);
}

.page-loader-mark {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, rgba(255, 255, 255, 0.2) 100%);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  box-shadow: var(--shadow-md);
  animation: loaderPulse 1.2s ease-in-out infinite;
}

body.is-loaded .page-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 650ms ease, transform 650ms ease;
}

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

/* Cursor refinement: subtle overlay while preserving the native system cursor. */
.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 80;
  will-change: transform, opacity;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.cursor-ring {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid rgba(123, 44, 255, 0.32);
  border-radius: 50%;
  background: rgba(123, 44, 255, 0.03);
  box-shadow: 0 0 0 0.2rem rgba(123, 44, 255, 0.05);
}

.cursor-dot {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: rgba(207, 180, 255, 0.95);
}

.cursor-ring.is-visible,
.cursor-dot.is-visible {
  opacity: 1;
}

.cursor-ring.is-active {
  --cursor-scale: 1.22;
  border-color: rgba(123, 44, 255, 0.48);
  background: rgba(123, 44, 255, 0.06);
}

.cursor-dot.is-active {
  --cursor-dot-scale: 1.15;
}

html[data-theme="light"] .cursor-ring {
  border-color: rgba(75, 0, 168, 0.22);
  background: rgba(123, 44, 255, 0.03);
  box-shadow: 0 0 0 0.2rem rgba(123, 44, 255, 0.04);
}

html[data-theme="light"] .cursor-dot {
  background: rgba(75, 0, 168, 0.8);
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.8rem);
  transition:
    opacity 220ms ease,
    visibility 220ms ease,
    transform 220ms ease,
    background 220ms ease;
  z-index: 30;
}

.back-to-top svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(123, 44, 255, 0.14);
}

/* ==========================================================================
   4. Header and Navigation
   ========================================================================== */

.site-header,
.hero-panel,
.project-card,
.timeline-card,
.contact-card {
  backdrop-filter: blur(18px);
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--surface-glass);
  box-shadow: var(--shadow-lg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #d7b5ff 100%);
  color: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.brand-photo,
.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-initials,
.profile-fallback {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
}

.brand-mark.image-missing .brand-photo,
.profile-frame.image-missing .profile-photo {
  display: none;
}

.brand-mark.image-missing .brand-initials,
.profile-frame.image-missing .profile-fallback {
  display: grid;
}

.brand-text {
  min-width: 0;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: end;
}

.theme-toggle,
.menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.theme-toggle:hover,
.menu-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.theme-toggle-icon {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 220ms ease, opacity 220ms ease;
}

.theme-icon svg,
.menu-toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-sun {
  opacity: 0;
  transform: scale(0.7) rotate(-18deg);
}

.theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.7) rotate(18deg);
}

.menu-toggle {
  gap: 0.22rem;
  padding: 0.7rem;
}

.menu-toggle span {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-header.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition:
    max-height 240ms ease,
    opacity 200ms ease,
    transform 200ms ease;
}

.site-header.nav-open .site-nav {
  max-height: 22rem;
  opacity: 1;
  transform: translateY(0);
  padding-top: 0.25rem;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  color: var(--muted);
  transition:
    color 180ms ease,
    background 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.55rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
  background: rgba(123, 44, 255, 0.08);
}

html[data-theme="light"] .site-nav a:hover,
html[data-theme="light"] .site-nav a.is-active {
  background: rgba(123, 44, 255, 0.08);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

/* ==========================================================================
   5. Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-areas:
    "content"
    "visual";
  gap: 1.5rem;
  align-items: start;
  padding: 0 0 calc(var(--section-space) - 1rem);
}

.hero-copy h1,
.section-intro h2,
.section-heading h2,
.contact-section h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-copy {
  grid-area: content;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  max-width: 38rem;
  margin: 0;
}

.hero-copy h1 {
  max-width: 8ch;
  margin: 0;
  font-size: var(--step-4);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-support {
  max-width: 58ch;
  color: var(--muted);
  font-size: var(--step--1);
}

.hero-text,
.section-body p,
.process-grid p,
.contact-copy,
.project-card p,
.timeline-card p {
  color: var(--muted);
  font-size: var(--step-0);
}

.hero-text {
  max-width: 34rem;
  font-size: var(--step-1);
  color: var(--text);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent) 0%, #9e62ff 100%);
  box-shadow: 0 14px 28px rgba(123, 44, 255, 0.24);
}

.button-secondary {
  border-color: rgba(123, 44, 255, 0.18);
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  grid-area: visual;
  display: grid;
  gap: 0.95rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(123, 44, 255, 0.06));
  box-shadow: var(--shadow-lg);
}

.hero-panel > * {
  margin: 0;
}

.profile-orbit {
  display: flex;
  justify-content: center;
}

.profile-frame {
  display: grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  padding: 0.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(123, 44, 255, 0.84), rgba(186, 150, 255, 0.72));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.profile-photo,
.profile-fallback {
  border-radius: 50%;
  background: var(--panel);
}

.profile-fallback {
  color: var(--text);
  font-size: 1.8rem;
}

.code-showcase {
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(14, 14, 20, 0.82);
  overflow: hidden;
}

html[data-theme="light"] .code-showcase {
  background: rgba(255, 255, 255, 0.9);
}

.code-showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.code-showcase-body {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
}

.code-line-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.8rem;
  opacity: 1;
  transform: translateY(0);
}

.code-line-number {
  color: rgba(255, 255, 255, 0.34);
}

html[data-theme="light"] .code-line-number {
  color: rgba(28, 39, 50, 0.34);
}

.code-line {
  color: var(--text);
  overflow-wrap: anywhere;
}

.code-token-keyword {
  color: #9d8dff;
}

.code-token-property {
  color: #b8c0ff;
}

.code-token-string {
  color: #93e2c0;
}

html[data-theme="light"] .code-token-keyword {
  color: #6b35d8;
}

html[data-theme="light"] .code-token-property {
  color: #3b4bc0;
}

html[data-theme="light"] .code-token-string {
  color: #237644;
}

.panel-label {
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-list {
  display: grid;
  gap: 0.75rem;
}

.focus-list li {
  position: relative;
  padding-left: 1rem;
  color: var(--muted);
}

.focus-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero-stats {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.hero-stats div {
  display: grid;
  gap: 0.15rem;
}

.hero-stats strong {
  font-size: var(--step-1);
}

.hero-stats span {
  color: var(--muted);
  font-size: var(--step--1);
}

/* ==========================================================================
   6. Sections, Cards, Grids
   ========================================================================== */

.section {
  padding: var(--section-space) 0;
}

.section-grid,
.contact-section {
  border-top: 1px solid var(--line);
}

.section-grid {
  display: grid;
  gap: 1.25rem;
}

.section-intro h2,
.section-heading h2,
.contact-section h2 {
  margin-top: 0.6rem;
  font-size: var(--step-3);
}

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

.section-lead {
  max-width: 56ch;
}

.about-list {
  display: grid;
  gap: 0.8rem;
}

.about-list li {
  position: relative;
  padding: 1rem 1rem 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.about-list li::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 1.32rem;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: var(--accent);
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  padding-left: 1.1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 1px;
  background: linear-gradient(180deg, rgba(123, 44, 255, 0.58), rgba(255, 255, 255, 0.05));
}

.timeline-card,
.project-card,
.process-grid article,
.contact-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.timeline-card {
  position: relative;
  display: grid;
  gap: 0.7rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(123, 44, 255, 0.04));
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 1.35rem;
  width: 0.8rem;
  height: 0.8rem;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.35rem rgba(123, 44, 255, 0.08);
}

.timeline-period,
.project-index {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-grid,
.process-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  display: grid;
  gap: 0;
  padding: 0;
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.project-card-muted {
  background: var(--surface-muted);
}

.project-card:hover,
.process-grid article:hover,
.social-links a:hover {
  transform: translateY(-4px);
}

.project-card:hover {
  border-color: rgba(123, 44, 255, 0.3);
  box-shadow: var(--shadow-lg);
}

.project-card h3,
.process-grid h3 {
  font-size: var(--step-1);
  line-height: 1.2;
}

/* Project cleanup: remove media dependency and rebalance spacing for text-only cards. */
.project-content {
  display: grid;
  gap: 1rem;
  height: 100%;
  padding: 1.4rem;
  align-content: start;
}

.project-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-tags,
.skills-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.project-tags li,
.skills-panel span {
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(123, 44, 255, 0.08);
  font-size: 0.88rem;
}

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

.project-link,
.contact-card a {
  font-weight: 700;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.project-link:hover,
.contact-card a:hover {
  color: var(--accent);
}

.contact-card a {
  color: var(--accent-strong);
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
}

.project-link:hover {
  transform: translateY(-1px);
}

.project-link-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, #9f66ff 100%);
  box-shadow: 0 12px 26px rgba(123, 44, 255, 0.22);
}

.project-link-secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.process-grid article {
  display: grid;
  gap: 0.65rem;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 220ms ease,
    border-color 220ms ease;
}

.skills-panel {
  padding-top: 0.25rem;
}

.contact-section {
  display: grid;
  gap: 1.2rem;
}

.contact-card {
  display: grid;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: var(--radius-xl);
  background: var(--surface-contact);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-sm);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.social-links a:hover {
  border-color: rgba(123, 44, 255, 0.28);
  background: rgba(123, 44, 255, 0.08);
}

.social-links svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.contact-email {
  font-size: 1rem;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
}

.contact-form span {
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--field-bg);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(123, 44, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(123, 44, 255, 0.12);
}

.contact-submit {
  width: 100%;
}

.contact-submit:disabled {
  opacity: 0.75;
  cursor: wait;
}

.form-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--danger);
}

/* ==========================================================================
   7. Footer
   ========================================================================== */

.site-footer {
  display: grid;
  gap: 1rem;
  padding: 1.75rem 0 0.35rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  align-items: center;
}

.footer-brand {
  display: grid;
  gap: 0.24rem;
}

.footer-name {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
}

.footer-role {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer-email {
  color: var(--text);
  font-size: 0.94rem;
  transition: color 180ms ease;
}

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

.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
}

/*.footer-handle {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}*/

/* ==========================================================================
   8. Responsive Layout
   ========================================================================== */

@media (min-width: 680px) {
  .page-shell {
    padding: 1.25rem 1.25rem 2.75rem;
  }

  .hero {
    gap: 1.75rem;
  }

  .project-grid,
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
  }

  .menu-toggle {
    display: none;
  }

  .site-nav {
    grid-column: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    max-height: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    padding-top: 0;
  }

  .site-nav a {
    min-height: 2.5rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.94rem;
  }

  .hero,
  .section-grid,
  .contact-section {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
    gap: 2rem;
  }

  .hero {
    grid-template-areas: "content visual";
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.82fr);
    align-items: start;
    min-height: calc(100svh - 6.4rem);
    padding: 0.15rem 0 0.25rem;
  }

  /* Hero regression fix: keep the text block higher with no extra top offset. */
  .hero-copy {
    align-self: start;
    justify-self: start;
    padding-right: 0.75rem;
    margin-top: 0;
    padding-top: 0;
  }

  .hero-panel {
    width: min(100%, 25rem);
    align-self: start;
    justify-self: end;
    margin-top: 0;
  }

  .section-grid {
    grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  }

  .contact-section {
    align-items: start;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
  }

  .process-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-frame {
    width: 7rem;
    height: 7rem;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    text-align: left;
  }

  .footer-brand {
    justify-self: start;
  }

  .footer-copy {
    justify-self: end;
    text-align: right;
  }
}

@media (max-width: 859px) {
  .hero {
    min-height: auto;
  }

  .hero-copy {
    align-content: start;
  }

  .hero-panel {
    width: 100%;
    justify-self: stretch;
  }

  .site-footer {
    text-align: center;
  }

  .footer-brand,
  .footer-copy {
    justify-self: center;
    text-align: center;
  }
}

@media (pointer: coarse), (hover: none), (max-width: 860px) {
  .cursor-ring,
  .cursor-dot {
    display: none;
  }
}

@media (min-width: 1100px) {
  .page-shell {
    padding-inline: 1.5rem;
  }

  .hero {
    gap: 2.1rem;
  }

  .hero-copy h1 {
    max-width: 9.5ch;
  }

  .hero-panel {
    padding: 1.2rem;
  }
}

@media (max-width: 479px) {
  .brand-text {
    max-width: 9rem;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }

  .button,
  .project-actions a {
    width: 100%;
  }
}

@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;
    scroll-behavior: auto !important;
  }

  .reveal,
  .code-line-item {
    opacity: 1;
    transform: none;
  }
}
