/*
  New minimal theme for Instatalenx
  - Neutral layout, fresh start
  - Keep language toggle, forms, copy buttons, toast
  - Improve spacing, type scale, contrast
*/

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #f59e0b; /* Amber / Orange to match logo */
  --accent: #f59e0b; /* Single-color theme uses primary as accent */
  --success: #22c55e;
  --danger: #ef4444;
  --ring: rgba(245, 158, 11, 0.25);

  --radius: 14px;
  --radius-sm: 8px;

  --container: clamp(280px, 88vw, 1120px);
  --space-2: clamp(8px, 1.5vw, 12px);
  --space-3: clamp(12px, 2vw, 16px);
  --space-4: clamp(16px, 2.5vw, 24px);
  --space-5: clamp(22px, 3vw, 32px);
  --space-6: clamp(28px, 4vw, 48px);

  --shadow-1: 0 1px 2px rgba(0,0,0,.08);
  --shadow-2: 0 10px 30px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fff6e9 42%, #ffffff 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }

.container { width: min(100%, var(--container)); margin: 0 auto; padding-inline: var(--space-4); }
.skip-link {
  position: absolute; left: -9999px; top: -9999px;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); background: var(--surface); padding: 6px 10px; border-radius: var(--radius-sm); }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; backdrop-filter: saturate(1.0) blur(6px);
background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Offset main content so fixed header doesn't overlap */
main { padding-top: clamp(64px, 8vh, 96px); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; }
.logo { display: inline-flex; align-items: center; gap: var(--space-3); }
.brand-image { filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.site-nav { display: flex; align-items: center; gap: clamp(8px, 2.2vw, 20px); }
.site-nav a { padding: 8px 12px; border-radius: 999px; color: var(--text); opacity: .9; transition: 120ms ease; }
.site-nav a:hover { background: rgba(245,158,11,0.10); opacity: 1; }
.header-lang { display: inline-flex; gap: 6px; margin-left: clamp(8px, 2vw, 24px); padding-left: clamp(8px, 2vw, 24px); border-left: 1px solid rgba(0,0,0,0.08); }
.lang-btn { font: inherit; color: var(--text); background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.12); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lang-btn.active { background: var(--primary); color: #fff; border-color: rgba(245,158,11,.4); box-shadow: 0 4px 16px rgba(245,158,11,.35); }

/* Hero */
.hero { position: relative; min-height: clamp(320px, 44vh, 560px); display: grid; place-items: center; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(0deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)), url('assets/ai-in-recruitment.png'); background-size: cover; background-position: center; background-repeat: no-repeat; }
#meshCanvas { width: 100%; height: 100%; display: block; }
.hero-content { position: relative; z-index: 1; text-align: center; padding: var(--space-6) 0; }
.headline { font-size: clamp(24px, 4.5vw, 44px); font-weight: 700; letter-spacing: .2px; margin: 0; text-shadow: none; }
.subheadline { margin-top: var(--space-3); color: var(--muted); font-size: clamp(14px, 1.6vw, 18px); }

/* Sections */
.section { padding: var(--space-6) 0; }
.section h2 { font-size: clamp(20px, 3vw, 28px); margin: 0 0 var(--space-4); }

.about-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
@media (min-width: 760px) { .about-grid { grid-template-columns: 1.1fr .9fr; } }
.about-col .lead { font-size: clamp(16px, 2.2vw, 20px); color: var(--text); opacity: .92; }

/* Solutions */
#solutions p { color: var(--muted); }

/* Process Flow */
.process-flow { margin-top: clamp(20px, 3vw, 40px); position: relative; }
.flow-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 28px); counter-reset: step; padding: 0; margin: 0; list-style: none; }
@media (max-width: 860px){ .flow-steps { grid-template-columns: 1fr; } }
@media (min-width: 1024px){ .flow-steps { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px){ .flow-steps { grid-template-columns: repeat(3, 1fr); } }
.flow-step { display: grid; grid-template-columns: 56px 1fr; align-items: start; gap: 12px; padding: clamp(10px, 2vw, 16px); border-radius: var(--radius); background: rgba(0,0,0,0.03); box-shadow: var(--shadow-1); }
.flow-icon svg { display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12)); }
.flow-title { margin: 0 0 4px; font-weight: 700; }
.flow-desc { margin: 0; color: var(--muted); }

/* Gradient connector */
.flow-connector { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #22d3ee, #a78bfa, #60a5fa); opacity: .4; top: calc(100% + 10px); border-radius: 999px; }
@media (max-width: 860px){ .flow-connector { display: none; } }

/* Reveal animation on steps */
.flow-step { transform: translateY(8px); opacity: 0; animation: flowIn .6s ease forwards; }
.flow-step:nth-child(2){ animation-delay: .06s; }
.flow-step:nth-child(3){ animation-delay: .12s; }
.flow-step:nth-child(4){ animation-delay: .18s; }
.flow-step:nth-child(5){ animation-delay: .24s; }
@keyframes flowIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Contact */
.contact-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-5); justify-items: center; }

/* Contact form card + tidy spacing */
.contact-form { display: grid; gap: clamp(16px, 2vw, 20px); background: var(--surface); border: 1px solid rgba(0,0,0,0.08); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: var(--space-6); max-width: 720px; margin-inline: auto; }
.contact-form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 18px); align-items: start; }
.contact-form .btn-primary { justify-self: start; margin-top: 6px; }

/* Uniform field spacing and full-width controls */
.form-field { display: grid; gap: 8px; }
.form-field input,
.form-field select,
.form-field textarea { width: 100%; border-radius: 10px; padding: 10px 12px; font-size: 16px; line-height: 1.4; }
.form-field label { display: block; font-weight: 600; margin: 0; }

/* Helper text */
.help { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 6px; }
@media (max-width: 640px) {
  .contact-form { padding: var(--space-5); }
  .contact-form .grid-2 { grid-template-columns: 1fr; }
}
input, select, textarea { background: rgba(0,0,0,0.02); color: var(--text); border: 1px solid rgba(0,0,0,0.14); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.12); background: rgba(0,0,0,0.03); color: var(--text); cursor: pointer; }
.btn-primary { background: linear-gradient(180deg, #fbbf24, #f59e0b); border-color: rgba(245,158,11,.4); box-shadow: 0 6px 22px rgba(245,158,11,.30); color: #fff; }
/* removed: .copy-btn styling (unused) */
/* removed: .copy-btn:hover styling (unused) */

/* removed: .dept-list (duplicate) */
/* removed: .dept-row (duplicate) */
/* removed: .dept-email (duplicate) */
/* removed: .dept-label (duplicate) */

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(20,28,44,.92); color: var(--text); padding: 10px 14px; border: 1px solid rgba(0,0,0,0.12); border-radius: 10px; box-shadow: var(--shadow-2); }

/* Footer */
.site-footer { border-top: 1px solid rgba(0,0,0,0.08); background: #ffffff; }
.footer-grid { display: grid; gap: var(--space-3); align-items: center; padding: var(--space-4) 0; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; } }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { opacity: .85; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-meta { color: var(--muted); }
.copyright { color: var(--muted); text-align: right; }

/* Utility */
[hidden] { display: none !important; }

/* Hero split layout */
.hero-split { min-height: clamp(420px, 54vh, 640px); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(16px, 3vw, 40px); padding: var(--space-6) 0; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-copy { display: grid; gap: clamp(10px, 2vw, 18px); }
.eyebrow { font-weight: 700; color: var(--text); opacity: .7; letter-spacing: .02em; }
.hero-title { font-size: clamp(30px, 6vw, 72px); line-height: 1.05; margin: 0; font-weight: 800; }
.hero-desc { color: var(--muted); font-size: clamp(14px, 2vw, 18px); max-width: 60ch; }
.hero-figure { margin: 0; }
.hero-figure img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-2); }
.hero-subtitle { color: var(--muted); font-size: clamp(16px, 2.4vw, 22px); font-weight: 600; }
.cta-row { display: flex; gap: clamp(10px, 2vw, 16px); padding-top: clamp(16px, 3vw, 28px); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(20px, 3.2vw, 48px); padding: calc(var(--space-6) + 8px) 0; }
.hero-copy { display: grid; gap: clamp(12px, 2.4vw, 22px); align-content: center; justify-items: start; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { justify-items: center; text-align: center; }
}

/* About Section */
.section.about-section {
  padding: 100px 0;
  background: radial-gradient(1200px 600px at 50% -200px, rgba(245, 158, 11, 0.10), transparent 60%);
}

.about-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px;
}
.about-header h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}
.about-subtitle {
  margin-top: 10px;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--muted);
}
.accent-line {
  display: inline-block;
  width: 88px;
  height: 2px;
  margin-top: 16px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 2px;
}

/* Two-column overview */
.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}
.about-copy .lead {
  font-size: 18px;
  color: var(--text);
}
.about-copy p { color: var(--muted); }
.about-visual {
  position: relative;
}
.about-visual svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(245, 158, 11, 0.10));
  border-radius: 20px;
}

/* Portals (3 icons) */
.about-portals { margin-top: 48px; }
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.portal-grid li { list-style: none; }
.portal-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.portal-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.18);
  transform: translateY(-2px);
}
.portal-icon { display: inline-flex; margin-bottom: 10px; }
.portal-card h3 { font-size: 18px; margin: 6px 0 6px; }
.portal-card p { color: var(--muted); font-size: 15px; }

/* Vision / Mission cards */
.about-cards { margin-top: 56px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.about-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 22px;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 16px;
  align-items: start;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.about-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.18);
  transform: translateY(-2px);
}
.card-icon { grid-column: 1 / 2; }
.about-card h3 { grid-column: 2 / 3; margin: 0 0 6px; font-size: 18px; }
.about-card p { grid-column: 2 / 3; color: var(--muted); }

/* Core values grid */
.values-wrap { margin-top: 56px; }
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.value-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.value-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 10px 32px rgba(245, 158, 11, 0.16);
  transform: translateY(-2px);
}
.value-icon { flex: 0 0 auto; }
.value-card h4 { margin: 2px 0 6px; font-size: 16px; }
.value-card p { color: var(--muted); font-size: 15px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 1024px) {
  .about-layout { grid-template-columns: 1fr; }
  .about-visual { order: -1; }
}
@media (max-width: 768px) {
  .portal-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
}

/* === Job Aid Process style overrides (keep theme colours) === */
.process-flow { padding-top: clamp(20px, 2.8vw, 28px); padding-bottom: clamp(20px, 2.8vw, 28px); }

/* Center timeline across the module */
.flow-connector { top: 50%; height: 3px; }

/* Disable diagonal connectors for cleaner, instructional look */
.flow-step::after, .flow-step .flow-icon::after { display: none !important; }

/* Step label under each card (Step 01..05) */
.flow-step { position: relative; }
/* unify: remove top-left chip and use bottom label consistently */
.flow-step::before {
  content: 'Step 0' counter(step);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  bottom: auto;
  transform: translateX(-50%);
  width: auto; height: auto; padding: 0;
  background: none; box-shadow: none; border-radius: 0;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
@media (max-width: 860px){
  .flow-connector { display: none; }
  .flow-step::before { position: static; transform: none; margin-top: 8px; display: block; text-align: center; }
}

/* Hexagon icon plate behind existing SVG (keeps current icons, colours remain) */
.flow-icon { position: relative; width: clamp(58px, 5.5vw, 72px); height: clamp(58px, 5.5vw, 72px); }
.flow-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0% 50%);
  background: linear-gradient(180deg, #ffffff, #fff6e9);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 22px rgba(17,24,39,.10);
  border-radius: 8px; /* subtle rounding for smoother look */
}
.flow-icon svg { position: relative; z-index: 1; width: 62%; height: auto; margin: 0 auto; display: block; }

/* Relaxed spacing & readability to match reference layout */
.flow-text { gap: clamp(8px, 1.8vw, 12px); }
.flow-title { font-weight: 800; }
.flow-desc { line-height: 1.9; }

/* Card: glassmorphism + equal sizing */
.flow-step { position: relative; counter-increment: step; display: grid; grid-template-columns: 60px 1fr; align-items: start; gap: 14px; padding: clamp(14px, 2.4vw, 18px); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.52)); border: 1px solid rgba(255,255,255,.55); box-shadow: 0 12px 28px rgba(17,24,39,.12), inset 0 1px 0 rgba(255,255,255,.35); backdrop-filter: saturate(1.08) blur(8px);
  min-height: clamp(150px, 18vw, 180px);
  margin-bottom: 36px; /* extra room for bottom Step label */
}
.flow-step:hover { box-shadow: 0 18px 40px rgba(17,24,39,.16); border-color: rgba(255,255,255,.65); transform: translateY(-1px); transition: 200ms ease; }

/* Step label — bottom centered (override any previous chips) */
 .flow-step::before {
   content: 'Step 0' counter(step);
   position: absolute;
   left: 50%;
   top: calc(100% + 6px);
   bottom: auto;
   transform: translateX(-50%);
   width: auto; height: auto; padding: 0;
   background: none; box-shadow: none; border-radius: 0;
   color: var(--muted); font-weight: 600; font-size: 14px;
 }

/* Connector arrow between cards (desktop) */
.flow-step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -18px; width: clamp(28px, 3.8vw, 46px); height: 2px; background: linear-gradient(90deg, #22d3ee, #a78bfa, #60a5fa); opacity: .55; transform: translateY(-50%); }
.flow-step:not(:last-child) .flow-icon { position: relative; }
.flow-step:not(:last-child) .flow-icon::after { content: ""; position: absolute; top: calc(50% - 1px); right: -20px; width: 10px; height: 10px; border-top: 2px solid rgba(96,165,250,.8); border-right: 2px solid rgba(96,165,250,.8); transform: translateY(-50%) rotate(45deg); opacity: .7; }
@media (max-width: 860px){ .flow-step::after, .flow-step .flow-icon::after { display: none; } }

/* Icon motion + glow */
.flow-icon svg { display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,.12)); transform-origin: 50% 50%; animation: iconFloat 10s ease-in-out infinite; }
.flow-step:nth-child(2) .flow-icon svg { animation-delay: .8s; }
.flow-step:nth-child(3) .flow-icon svg { animation-delay: 1.6s; }
.flow-step:nth-child(4) .flow-icon svg { animation-delay: 2.4s; }
.flow-step:nth-child(5) .flow-icon svg { animation-delay: 3.2s; }
.flow-icon svg:hover { transform: translateY(-2px) scale(1.02); filter: drop-shadow(0 10px 22px rgba(34,211,238,.25)); }

/* Text hierarchy & bilingual readability */
.flow-text { display: grid; gap: 6px; }
.flow-title { margin: 0; font-weight: 800; letter-spacing: .01em; font-size: clamp(16px, 2vw, 18px); }
.flow-desc { margin: 0; color: var(--muted); line-height: 1.7; font-size: clamp(13px, 1.8vw, 15px); }

/* Gradient baseline under the row for continuity */
.flow-connector { position: absolute; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #22d3ee, #a78bfa, #60a5fa); opacity: .35; top: calc(100% + 12px); border-radius: 999px; }

/* Animations */
@keyframes iconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes particleShift { 0% { transform: translateX(0); opacity: .8; } 50% { transform: translateX(18px); opacity: .6; } 100% { transform: translateX(0); opacity: .8; } }
/* Go to Top button */
.go-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.go-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.go-top-btn svg { flex: 0 0 auto; }
.go-top-btn .go-top-label { font-size: 14px; }
.go-top-btn:focus-visible { outline: 2px solid var(--accent, #22d3ee); outline-offset: 2px; }
@media (max-width: 640px) {
  .go-top-btn { right: 16px; bottom: 16px; }
}
@media (max-width: 860px){ .flow-step::after, .flow-step .flow-icon::after { display: none; } }

/* Icon motion + glow */
.flow-icon svg { display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,.12)); transform-origin: 50% 50%; animation: iconFloat 10s ease-in-out infinite; }
.flow-step:nth-child(2) .flow-icon svg { animation-delay: .8s; }
.flow-step:nth-child(3) .flow-icon svg { animation-delay: 1.6s; }
.flow-step:nth-child(4) .flow-icon svg { animation-delay: 2.4s; }
.flow-step:nth-child(5) .flow-icon svg { animation-delay: 3.2s; }
.flow-icon svg:hover { transform: translateY(-2px) scale(1.02); filter: drop-shadow(0 10px 22px rgba(34,211,238,.25)); }

/* Text hierarchy & bilingual readability */
.flow-text { display: grid; gap: 6px; }
.flow-title { margin: 0; font-weight: 800; letter-spacing: .01em; font-size: clamp(16px, 2vw, 18px); }
.flow-desc { margin: 0; color: var(--muted); line-height: 1.7; font-size: clamp(13px, 1.8vw, 15px); }

/* Gradient baseline under the row for continuity */
.flow-connector { position: absolute; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #22d3ee, #a78bfa, #60a5fa); opacity: .35; top: calc(100% + 12px); border-radius: 999px; }

/* Animations */
@keyframes iconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes particleShift { 0% { transform: translateX(0); opacity: .8; } 50% { transform: translateX(18px); opacity: .6; } 100% { transform: translateX(0); opacity: .8; } }