/* ═══════════════════════════════════════════════════════════════
   ANTIGRAVITY — Global Design Tokens
   Violet & Rose Gold Palette — 60 / 30 / 10 Color Rule
   Portfolio: [OWNER_NAME]
═══════════════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {

  /* ── Font Families ─────────────────────────────────────────── */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* ── Type Scale ────────────────────────────────────────────── */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.5rem;
  --text-5xl: 5rem;
  --text-hero: clamp(3.5rem, 9vw, 7.5rem);

  /* ── 60% Background (Blush White) ─────────────────────────── */
  --color-bg: #FFF4F0;
  --color-bg-muted: #FFE8DF;
  --color-bg-card: #FFFFFF;
  --color-bg-subtle: #F5D5C8;

  /* ── 30% Structure (Deep Violet) ──────────────────────────── */
  --color-primary: #4A006A;
  --color-primary-light: #6A0096;
  --color-primary-dark: #3A0052;
  --color-text: #4A006A;
  --color-text-muted: rgba(74, 0, 106, 0.55);
  --color-border: rgba(74, 0, 106, 0.12);
  --color-border-strong: rgba(74, 0, 106, 0.25);

  /* ── 10% Accent (Rose Gold) ────────────────────────────────── */
  --color-accent: #E8735A;
  --color-accent-hover: #D45A40;
  --color-accent-pressed: #C24430;
  --color-accent-light: #F5A990;
  --color-accent-bg: rgba(232, 115, 90, 0.08);
  --color-accent-glow: rgba(232, 115, 90, 0.22);

  /* ── Overlay & Glass ───────────────────────────────────────── */
  --color-overlay: rgba(74, 0, 106, 0.06);
  --color-glass-bg: rgba(255, 244, 240, 0.75);
  --color-glass-border: rgba(74, 0, 106, 0.10);

  /* ── On-Dark Surfaces ──────────────────────────────────────── */
  --color-on-dark: #FFFFFF;
  --color-on-dark-muted: rgba(255, 255, 255, 0.60);

  /* ── Spacing ───────────────────────────────────────────────── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ── Border Radius ─────────────────────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* ── Shadows (violet-tinted, not black) ─────────────────────── */
  --shadow-xs: 0 1px 4px rgba(74, 0, 106, 0.06);
  --shadow-sm: 0 2px 12px rgba(74, 0, 106, 0.08);
  --shadow-md: 0 6px 24px rgba(74, 0, 106, 0.10);
  --shadow-lg: 0 16px 40px rgba(74, 0, 106, 0.12);
  --shadow-xl: 0 28px 60px rgba(74, 0, 106, 0.14);
  --shadow-card: 0 8px 32px rgba(74, 0, 106, 0.10),
    0 0 0 1px rgba(74, 0, 106, 0.06);
  --shadow-accent: 0 4px 20px rgba(232, 115, 90, 0.35);
  --shadow-pill: 0 4px 20px rgba(74, 0, 106, 0.18),
    0 1px 4px rgba(74, 0, 106, 0.10);

  /* ── Animation ─────────────────────────────────────────────── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-instant: 100ms;
  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 600ms;
  --duration-flip: 700ms;
}

/* ── Base Reset & Body ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: pageEnter 400ms var(--ease-out-expo) both;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background-color: rgba(255, 244, 240, 0.55);
}

body.page-projects::before,
body.page-detail-project::before {
  background-color: rgba(255, 244, 240, 0.72);
}

body.page-contact::before,
body.page-resume::before {
  background-color: rgba(255, 244, 240, 0.72);
}

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

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

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
textarea {
  font-family: inherit;
}

/* ── Typography ─────────────────────────────────────────────── */
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 1.1;
}

h1 {
  font-weight: 700;
  font-size: var(--text-4xl);
}

h2 {
  font-weight: 600;
  font-size: var(--text-3xl);
  line-height: 1.15;
}

h3 {
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: 1.2;
}

h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--color-text);
  line-height: 1.3;
}

p {
  line-height: 1.7;
}

/* ── Section Label (above headings) ─────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-3);
}

/* ── Title Underline (rose gold bar) ────────────────────────── */
.title-underline {
  width: 48px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-top: 16px;
}

.title-underline--lg {
  width: 64px;
}

/* ── Content Container ──────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

/* ── Section Divider ────────────────────────────────────────── */
hr.section-divider {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-16) 0;
}

/* ── Focus Ring ─────────────────────────────────────────────── */
:focus-visible {
  outline: 2.5px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: inherit;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-accent);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: none;
  box-shadow: 0 2px 12px rgba(232, 115, 90, 0.25);
  transition: background var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    transform 150ms ease;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--color-accent-pressed);
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 11px 27px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(74, 0, 106, 0.30);
  transition: background var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(74, 0, 106, 0.05);
  border-color: var(--color-primary);
}

.btn-ghost:active {
  transform: scale(0.98);
}

/* ── Tag / Badge Pills ──────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-xs);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 115, 90, 0.20);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.tag:hover {
  background: rgba(232, 115, 90, 0.15);
  border-color: rgba(232, 115, 90, 0.40);
}

/* ── Available Badge ────────────────────────────────────────── */
.badge-available {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.12);
  color: #16A34A;
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
}

.badge-available::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  animation: dotPulse 2s infinite;
}

/* ── Form Inputs ────────────────────────────────────────────── */
input,
textarea {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
  width: 100%;
}

::placeholder {
  color: var(--color-text-muted);
  font-weight: 300;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}

input.error,
textarea.error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  display: block;
}

/* ── Page Transition ────────────────────────────────────────── */
body.page-leaving {
  opacity: 0;
  transition: opacity 200ms ease;
}

/* ═══════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
═══════════════════════════════════════════════════════════════ */

/* Page enter */
@keyframes pageEnter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Entrance fade-up — timeline cards, text blocks */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

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

/* Pulse rings on home card — from card_flip.html, recolored to rose gold */
@keyframes pulseGlow {
  0% {
    transform: scale(2);
    opacity: 0;
    box-shadow: 0 0 50px rgba(232, 115, 90, 0.30);
  }

  50% {
    transform: translate(0, -5px) scale(1);
    opacity: 1;
    box-shadow: 0 8px 20px rgba(232, 115, 90, 0.30);
  }

  100% {
    transform: translate(0, 5px) scale(0.1);
    opacity: 0;
    box-shadow: 0 10px 20px rgba(232, 115, 90, 0);
  }
}

/* Timeline center line draw */
@keyframes timelineGrow {
  from {
    transform: scaleY(0);
    transform-origin: top center;
  }

  to {
    transform: scaleY(1);
    transform-origin: top center;
  }
}

/* Stat counter number fade-in */
@keyframes countFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* "Available" dot pulse */
@keyframes dotPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.6;
  }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════════ */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }

  /* Flatten 3D flip to opacity swap */
  .card {
    transition: none !important;
  }

  .card-container:hover .card {
    transform: none !important;
  }

  .card-container:hover .card-face.card-front {
    opacity: 0;
  }

  .card-container:hover .card-face.card-back {
    opacity: 1;
    transform: rotateY(0deg) !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
  }

  /* General scroll animations */
  .animate-on-scroll,
  .timeline-card,
  .timeline-entry,
  .timeline-entry .card-container {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER — Shared across Projects, Experience, Contact, Resume
   Source: PRD §5.2, §5.3, §5.4, §5.7 — Design Doc §7.2
   Centralized here so all pages inherit it from global.css.
═══════════════════════════════════════════════════════════════ */
.page-header {
  padding: var(--space-24) 0 var(--space-16);
  text-align: left;
}

.page-header__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  line-height: 0.95;
  margin: 0 0 var(--space-4) 0;
}

.page-header__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-text-muted);
  max-width: 480px;
  line-height: 1.6;
}

/* Rose-gold underline bar — 80×3px */
.page-header__line {
  width: 80px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: var(--space-6) 0;
}

@media (max-width: 1023px) {
  .page-header__title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 767px) {
  .page-header {
    padding: var(--space-16) 0 var(--space-8);
    text-align: center;
  }

  .page-header__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .page-header__line {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER — Shared across all pages
   Source: PRD §6.3, Design Doc §6.7
═══════════════════════════════════════════════════════════════ */
.footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-16) 0 var(--space-8);
}

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

.footer__name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: var(--space-2);
}

.footer__diamond {
  color: var(--color-accent);
  margin: 0 var(--space-2);
}

.footer__tagline {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-8);
}

.footer__socials {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    background var(--duration-fast) ease;
}

.footer__social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(232, 115, 90, 0.08);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer__copyright {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.4);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__credit {
  color: rgba(255, 255, 255, 0.3);
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.footer__credit-accent {
  color: var(--color-accent);
}

/* ── Scroll Progress Bar ────────────────────────────────────── */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-accent);
  z-index: 9999;
  transition: none;
}

@media (max-width: 639px) {
  .footer {
    padding: var(--space-12) 0 var(--space-6);
  }
}

/* ═══════════════════════════════════════════════════════════════
   PER-PAGE BACKGROUND IMAGES
═══════════════════════════════════════════════════════════════ */
body.page-home {
  background-image: url('../Japan Blush.png');
}

body.page-projects {
  background-image: url('../Australia blush.png');
}

body.page-experience {
  background-image: url('../Russia Blush.png');
}

body.page-contact {
  background-image: url('../Slovenia blush.png');
}

body.page-resume {
  background-image: url('../Turkey Blush.png');
}

body.page-detail-project {
  background-image: url('../Australia blush.png');
}

body.page-detail-experience {
  background-image: url('../Russia Blush.png');
}