/* ============================================
   PKSecurity — design system
   ============================================ */
:root {
  --bg: #0a0a0c;
  --bg-elev: #111114;
  --bg-card: #131318;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #f4f4f5;
  --fg-dim: #a1a1aa;
  --fg-mute: #71717a;
  --accent: #ff3057;
  --accent-soft: rgba(255, 48, 87, 0.12);
  --accent-glow: rgba(255, 48, 87, 0.5);
  --term: #4ade80;
  --term-dim: #16a34a;
  --radius: 12px;
  --radius-lg: 18px;
  --max: 1200px;
  --pad-x: clamp(20px, 4vw, 40px);
  --section-y: clamp(80px, 12vw, 140px);
  --font-sans: "Inter", "Pretendard", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "ss01", "cv11";
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.01em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }

/* ============================================
   Background layers
   ============================================ */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
}
.bg-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.bg-glow {
  position: fixed; top: -10%; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 60vh; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 60%);
  filter: blur(60px); opacity: 0.6;
}

/* ============================================
   Header / Nav
   ============================================ */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: rgba(10, 10, 12, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.header.scrolled {
  border-bottom-color: var(--line);
  background: rgba(10, 10, 12, 0.85);
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo {
  display: inline-flex; align-items: baseline; gap: 1px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; letter-spacing: -0.02em;
}
.logo-mark { color: var(--accent); }
.logo-cursor { color: var(--accent); animation: blink 1.1s steps(2) infinite; margin-right: 1px; }
.logo-text { color: var(--fg); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-dim);
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.nav-cta {
  background: var(--fg) !important;
  color: var(--bg) !important;
  margin-left: 8px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--accent) !important; color: #fff !important; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--fg); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative; z-index: 1;
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(80px, 12vw, 140px);
  overflow: hidden;
}
.hero-meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--fg-dim);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 28px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2s ease-in-out infinite;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 11vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin-bottom: 28px;
}
.hero-title .line { display: block; }
.hero-title .accent {
  background: linear-gradient(90deg, var(--accent) 0%, #ff7a8a 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  font-weight: 600;
}
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(2) infinite;
  font-weight: 500;
}

.hero-sub {
  max-width: 620px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 36px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 64px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn svg { transition: transform 0.2s ease; }
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 12px 30px -10px var(--accent-glow);
}
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--fg-dim);
  background: rgba(255,255,255,0.04);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 24px;
}
.stat {
  padding: 24px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 4px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Hero terminal */
.hero-terminal {
  position: relative;
  margin: 0 auto 64px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #08080a;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--line);
  font-family: var(--font-mono);
  font-size: 14px;
  max-width: 760px;
  width: 100%;
}
.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: #0e0e10;
  border-bottom: 1px solid var(--line);
}
.terminal-bar span {
  width: 11px; height: 11px; border-radius: 50%; background: #2a2a2e;
}
.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar em {
  font-style: normal; margin-left: auto;
  font-size: 12px; color: var(--fg-mute);
}
.terminal-body {
  padding: 22px;
  color: var(--fg-dim);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
}
.t-prompt { color: var(--term); }
.t-path { color: #60a5fa; }
.t-cmd { color: var(--fg); }
.t-out { color: var(--fg-dim); }
.t-acc { color: var(--accent); font-weight: 500; }
.t-blink { color: var(--term); animation: blink 1s steps(2) infinite; }

/* ============================================
   Sections
   ============================================ */
.section {
  position: relative; z-index: 1;
  padding: var(--section-y) 0;
  border-top: 1px solid var(--line);
}
.section-alt { background: var(--bg-elev); }

.section-head { margin-bottom: clamp(40px, 6vw, 64px); max-width: 800px; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  font-weight: 500;
}
.bracket { color: var(--fg-mute); }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.section-sub {
  margin-top: 18px;
  color: var(--fg-dim);
  font-size: 17px;
  max-width: 600px;
}
.section-sub a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.section-sub a:hover { border-bottom-color: var(--accent); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.about-lead {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.45;
  color: var(--fg);
  font-weight: 400;
  letter-spacing: -0.015em;
}
.about-lead strong { color: var(--accent); font-weight: 500; }
.about-points { display: flex; flex-direction: column; gap: 24px; }
.about-points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.about-points .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  padding-top: 4px;
}
.about-points h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.about-points p { color: var(--fg-dim); font-size: 15px; }

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service-card {
  background: var(--bg-card);
  padding: clamp(28px, 3.5vw, 40px);
  display: flex; flex-direction: column;
  gap: 14px;
  position: relative;
  transition: background 0.2s ease;
}
.service-card:hover { background: #181820; }
.service-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
}
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.service-card p { color: var(--fg-dim); font-size: 15px; line-height: 1.6; }
.service-tag {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: auto;
  padding-top: 16px;
}

/* Research */
.research-list {
  border-top: 1px solid var(--line);
}
.research-item {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.25s ease;
}
.research-item:hover { padding-left: 16px; padding-right: 16px; background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 100%); }
.research-item:hover h3 { color: var(--accent); }
.research-meta { display: flex; flex-direction: column; gap: 8px; }
.research-meta .mono { font-size: 13px; color: var(--fg-mute); }
.research-tag {
  display: inline-block;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.research-item h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
  /* Reserve 2 lines so 1-line and 2-line titles share the same row height */
  min-height: calc(22px * 1.35 * 2);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
  overflow-wrap: anywhere;
}
.research-arrow {
  font-size: 24px;
  color: var(--fg-mute);
  transition: transform 0.25s ease, color 0.2s ease;
}
.research-item:hover .research-arrow { transform: translateX(6px); color: var(--accent); }

/* Careers */
.careers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.career-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.career-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.career-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.career-card:hover::before { opacity: 1; }
.career-tag {
  font-size: 12px;
  color: var(--term);
}
.career-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  position: relative;
}
.career-card p { color: var(--fg-dim); font-size: 14px; flex: 1; position: relative; }
.career-apply {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 8px;
  position: relative;
  align-self: flex-start;
  transition: gap 0.2s ease;
}
.career-apply:hover { letter-spacing: 0.02em; }

/* Sponsor */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.sponsor-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.2s;
}
.sponsor-card:hover { border-color: var(--line-strong); }
.sponsor-mark {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.sponsor-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.sponsor-card p { color: var(--fg-dim); font-size: 15px; }

/* Contact */
.section-contact { padding-bottom: clamp(60px, 10vw, 100px); }
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.contact-copy p { color: var(--fg-dim); font-size: 17px; margin-top: 18px; max-width: 500px; }
.contact-links { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.contact-link {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: var(--bg-card);
  transition: background 0.2s, padding 0.25s;
}
.contact-link:hover {
  background: #181820;
  padding-left: 32px;
}
.contact-link:hover .contact-arrow { color: var(--accent); transform: translateX(4px); }
.contact-label { font-size: 12px; color: var(--fg-mute); }
.contact-value {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  letter-spacing: -0.02em;
  word-break: break-all;
}
.contact-arrow {
  font-size: 22px;
  color: var(--fg-mute);
  transition: transform 0.25s, color 0.2s;
}

/* Footer */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 36px 0;
}
.footer-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.footer-brand .logo-mark { color: var(--accent); font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.footer-brand .logo-text { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.footer-brand p { font-size: 13px; color: var(--fg-mute); }
.footer-meta { font-size: 13px; color: var(--fg-mute); }

/* ============================================
   Animations
   ============================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .about-grid, .contact-inner {
    grid-template-columns: 1fr;
  }
  .research-item {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }
  .research-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .contact-link {
    grid-template-columns: 1fr auto;
  }
  .contact-label { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px;
    background: rgba(10, 10, 12, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
  }
  .nav.open a {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 16px;
  }
  .nav.open .nav-cta { margin-left: 0; margin-top: 8px; text-align: center; }

  .hero-stats {
    grid-template-columns: 1fr;
  }
  .stat { border-right: none; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: none; }

  .hero-terminal { font-size: 12px; }
  .terminal-body { padding: 16px; }

  .footer-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .research-item h3 {
    font-size: 19px;
    min-height: calc(19px * 1.35 * 2);
  }
}

@media (max-width: 480px) {
  .hero-title { letter-spacing: -0.04em; }
  .btn { padding: 12px 18px; font-size: 14px; }
  .career-card, .sponsor-card { padding: 24px; }
  .service-card { padding: 24px; }
  .research-item h3 {
    font-size: 17px;
    min-height: calc(17px * 1.35 * 2);
  }
}
