/* ================================================
   SHARED STYLESHEET — style.css
   Covers: index (home), contact, and all pages
   ================================================ */


/* ─── TOKENS ─── */
:root {
  --amber: #f5a623;
  --amber-dim: #b87418;
  --amber-glow: rgba(245, 166, 35, 0.12);
  --bg: #0d0e0f;
  --surface: #141618;
  --card: #1a1d20;
  --border: #2a2d31;
  --text: #d4d6d9;
  --muted: #5a5f66;
  --code-bg: #111315;
  --error: #fb7185;
  --success: #22c55e;

  /* section accent palette (home portal cards) */
  --c-models: #38bdf8;
  --c-games: #a78bfa;
  --c-resume: #22c55e;
  --c-photos: #fb923c;
  --c-music: #e879f9;
  --c-donate: #f5a623;
  --c-videos: #fb7185;
  --c-store: #34d399;
  --c-contact: #60a5fa;
  --c-git: #f5a623;

  --font-display: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 6px;
  --transition: 180ms ease;
}

[data-theme="light"] {
  --bg: #f5f4f0;
  --surface: #eceae4;
  --card: #ffffff;
  --border: #d8d5cc;
  --text: #1a1a1a;
  --muted: #888077;
  --code-bg: #f0ede6;
}


/* ─── RESET ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  line-height: 1.5;
  overflow-x: hidden;
}


/* ─── NOISE TEXTURE ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ─── GRID BACKGROUND ─── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 100%);
}


/* ─── HEADER ─── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.brand h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--amber);
}

.brand h1 span {
  color: var(--text);
}

.brand .tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Back button (sub-pages) */
.back-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 12px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition), border-color var(--transition);
}

.back-btn:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}

/* Theme toggle */
.theme-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  transition: color var(--transition), border-color var(--transition);
}

.theme-btn:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}


/* ─── HERO (home) ─── */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.05s;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--amber);
}

.hero h2 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
  max-width: 900px;
}

.hero h2 em {
  color: var(--amber);
  font-style: normal;
  position: relative;
}

.hero p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.7;
}


/* ─── STATUS BAR (home) ─── */
.status-bar {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.15s;
}

.status-item {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}


/* ─── PORTAL GRID (home) ─── */
.portal-grid {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 160px;
  gap: 10px;
}


/* ─── PORTAL CARD (home) ─── */
.pcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 22px 18px;
  overflow: hidden;
  position: relative;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  cursor: pointer;
  grid-column: span 1;
  grid-row: span 1;
  animation: fadeUp 0.5s ease both;
}

/* accent left bar */
.pcard::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0.5;
  transition: opacity 220ms ease, width 220ms ease;
}

/* glow blob on hover */
.pcard::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  filter: blur(40px);
  transition: opacity 350ms ease, transform 350ms ease;
  pointer-events: none;
}

.pcard:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pcard:hover::before { opacity: 1; width: 4px; }
.pcard:hover::after  { opacity: 0.15; transform: scale(1.2); }

.pcard-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: grayscale(0.2);
  transition: transform 220ms ease;
}

.pcard:hover .pcard-icon { transform: scale(1.15); }

.pcard-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.pcard-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  transition: color 220ms ease;
}

.pcard:hover .pcard-label { color: var(--accent); }

.pcard-arrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform 220ms ease, color 220ms ease;
  flex-shrink: 0;
}

.pcard:hover .pcard-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

.pcard-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ─── CARD ACCENT COLORS ─── */
.pcard-models  { --accent: var(--c-models); }
.pcard-games   { --accent: var(--c-games); }
.pcard-resume  { --accent: var(--c-resume); }
.pcard-photos  { --accent: var(--c-photos); }
.pcard-music   { --accent: var(--c-music); }
.pcard-donate  { --accent: var(--c-donate); }
.pcard-videos  { --accent: var(--c-videos); }
.pcard-store   { --accent: var(--c-store); }
.pcard-contact { --accent: var(--c-contact); }
.pcard-git {
  --accent: var(--c-git);
  border-color: var(--amber-dim);
  background: linear-gradient(135deg, var(--card) 0%, rgba(245, 166, 35, 0.06) 100%);
}

/* Git badge */
.pcard-git-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-glow);
  border: 1px solid var(--amber-dim);
  padding: 2px 8px;
  border-radius: 100px;
  width: fit-content;
  margin-bottom: 4px;
}

/* ─── CARD ANIMATION DELAYS ─── */
.pcard:nth-child(1)  { animation-delay: 0.10s; }
.pcard:nth-child(2)  { animation-delay: 0.15s; }
.pcard:nth-child(3)  { animation-delay: 0.18s; }
.pcard:nth-child(4)  { animation-delay: 0.21s; }
.pcard:nth-child(5)  { animation-delay: 0.24s; }
.pcard:nth-child(6)  { animation-delay: 0.27s; }
.pcard:nth-child(7)  { animation-delay: 0.30s; }
.pcard:nth-child(8)  { animation-delay: 0.33s; }
.pcard:nth-child(9)  { animation-delay: 0.36s; }
.pcard:nth-child(10) { animation-delay: 0.39s; }
.pcard:nth-child(11) { animation-delay: 0.42s; }


/* ─── PAGE WRAP (sub-pages) ─── */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}


/* ─── LEFT PANEL / PAGE HERO (sub-pages) ─── */
.left-panel {
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.05s;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--amber);
}

.left-panel h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.left-panel h2 em {
  color: var(--amber);
  font-style: normal;
}

.left-panel p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 560px;
}


/* ─── INFO LIST (contact page) ─── */
.info-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.10s;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--muted);
  transition: border-color var(--transition);
}

.info-item:hover { border-color: var(--amber-dim); }

.info-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-item strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  font-size: 0.78rem;
  margin-bottom: 2px;
}


/* ─── FORM PANEL (contact page) ─── */
.form-panel {
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.18s;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

/* amber top accent line */
.form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), transparent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.field.full { grid-column: 1 / -1; }

label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

label .required {
  color: var(--amber);
  font-size: 0.8rem;
}

input,
select,
textarea {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder { color: var(--muted); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

input.invalid,
select.invalid,
textarea.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12);
}

textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5f66' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select option {
  background: var(--card);
  color: var(--text);
}

/* ─── FIELD ERROR ─── */
.field-error {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--error);
  display: none;
  margin-top: -4px;
}

.field-error.visible { display: block; }

/* ─── CHAR COUNTER ─── */
.char-counter {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: var(--muted);
  text-align: right;
  margin-top: -14px;
  margin-bottom: 18px;
}

.char-counter.warn { color: var(--amber); }
.char-counter.over { color: var(--error); }

/* ─── SUBMIT BUTTON ─── */
.submit-btn {
  width: 100%;
  background: var(--amber);
  color: #0d0e0f;
  border: none;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.submit-btn:hover {
  background: #f7b84a;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(245, 166, 35, 0.3);
}

.submit-btn:active  { transform: translateY(0); }

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* spinner inside button */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #0d0e0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.submit-btn.loading .spinner   { display: block; }
.submit-btn.loading .btn-text  { opacity: 0.6; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── TOAST NOTIFICATION ─── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  white-space: nowrap;
}

.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--error); }

.toast-icon { font-size: 1.1rem; }

/* ─── FORM DIVIDER / NOTE ─── */
.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.form-note {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 14px;
}


/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--amber); }


/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ─── RESPONSIVE ─── */

/* Portal grid */
@media (max-width: 1100px) {
  .portal-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 155px;
  }
}

@media (max-width: 720px) {
  .portal-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 145px;
  }
}

@media (max-width: 600px) {
  .info-list    { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
  .form-card    { padding: 24px 18px; }
  .page-wrap    { padding: 36px 16px 80px; }
}

@media (max-width: 520px) {
  .portal-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 135px;
    gap: 8px;
  }

  .hero h2       { font-size: 2.2rem; }
  .pcard-label   { font-size: 0.9rem; }
}

@media (max-width: 400px) {
  .left-panel h2 { font-size: 2rem; }
}

@media (max-width: 340px) {
  .portal-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 120px;
  }
}