/* ============================================================
   Qilinfish Studio — core stylesheet
   Minimal industrial dark aesthetic. Single navy accent.
   Type pairing: Inter / Noto Sans TC + JetBrains Mono.
   ============================================================ */

:root {
  --bg-0:        #0a0a0c;
  --bg-1:        #0f0f12;
  --bg-2:        #15151a;
  --bg-3:        #1c1c22;
  --line:        #26262e;
  --line-soft:   #1a1a20;
  --fg-0:        #e8e8ec;
  --fg-1:        #b6b6bf;
  --fg-2:        #6f6f7a;
  --fg-3:        #4a4a52;
  --accent:      oklch(0.58 0.12 252);   /* navy */
  --accent-soft: oklch(0.58 0.12 252 / 0.18);
  --accent-line: oklch(0.58 0.12 252 / 0.55);
  --warn:        oklch(0.72 0.14 75);

  --font-sans:  'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono:  'JetBrains Mono', 'Menlo', 'Consolas', monospace;

  --radius:     2px;
  --t-fast:     120ms ease;
  --t-base:     220ms cubic-bezier(.4,.0,.2,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--fg-0); }

/* ============================================================
   Global background grid (industrial blueprint feel)
   ============================================================ */
.bg-grid {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

.bg-noise {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ============================================================
   Top navigation
   ============================================================ */
.qf-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10,10,12,0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.qf-nav__brand {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg-0);
}
.qf-nav__brand .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-1px);
  box-shadow: 0 0 10px var(--accent-line);
}
.qf-nav__brand .ch  { letter-spacing: 0.18em; }
.qf-nav__brand .en  { color: var(--fg-2); }

.qf-nav__menu {
  display: flex;
  gap: 4px;
  align-items: center;
}
.qf-nav__menu a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-1);
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.qf-nav__menu a .num {
  color: var(--fg-3); font-size: 10px;
}
.qf-nav__menu a:hover {
  color: var(--fg-0);
  background: var(--bg-2);
  border-color: var(--line);
}
.qf-nav__menu a.is-active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.qf-nav__lang {
  display: inline-flex;
  margin-left: 18px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
}
.qf-nav__lang button {
  background: transparent;
  color: var(--fg-2);
  border: none;
  padding: 6px 10px;
  letter-spacing: 0.1em;
}
.qf-nav__lang button.is-active {
  background: var(--accent);
  color: #06060a;
}

/* ============================================================
   Layout primitives
   ============================================================ */
.qf-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 64px;
}
.qf-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 40px;
}
.qf-section--tight { padding: 48px 40px; }

.qf-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.qf-eyebrow::before {
  content: ""; display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent);
}

.qf-title {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 500;
  margin: 18px 0 0;
  color: var(--fg-0);
  text-wrap: balance;
}
.qf-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  letter-spacing: 0.1em;
}
.qf-lede {
  margin-top: 24px;
  max-width: 640px;
  color: var(--fg-1);
  font-size: 17px;
  line-height: 1.65;
  text-wrap: pretty;
}

/* ============================================================
   Hero
   ============================================================ */
.qf-hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 40px;
}

.qf-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .qf-hero__inner { grid-template-columns: 1fr; gap: 32px; }
}

.qf-hero__crosshair {
  position: absolute;
  inset: 24px;
  pointer-events: none;
  border: 1px solid var(--line-soft);
  z-index: 1;
}
.qf-hero__crosshair::before,
.qf-hero__crosshair::after {
  content: ""; position: absolute;
  background: var(--line);
}
.qf-hero__crosshair::before {
  left: 0; right: 0; top: 50%; height: 1px;
}
.qf-hero__crosshair::after {
  top: 0; bottom: 0; left: 50%; width: 1px;
}

.qf-hero__corner {
  position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--accent);
}
.qf-hero__corner.tl { top: 18px; left: 18px;  border-right: none; border-bottom: none; }
.qf-hero__corner.tr { top: 18px; right: 18px; border-left: none;  border-bottom: none; }
.qf-hero__corner.bl { bottom: 18px; left: 18px;  border-right: none; border-top: none; }
.qf-hero__corner.br { bottom: 18px; right: 18px; border-left: none;  border-top: none; }

.qf-hero__brand {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  letter-spacing: 0.16em;
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px;
}
.qf-hero__brand .pulse {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.2);  box-shadow: 0 0 12px var(--accent-line); }
}

.qf-hero h1 {
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 24px;
  color: var(--fg-0);
}
.qf-hero h1 .accent { color: var(--accent); font-style: italic; font-weight: 400; }

.qf-hero__tagline {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-1);
  margin: 0 0 8px;
  min-height: 1.6em;
}
.qf-hero__tagline::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.qf-hero__meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-2);
}
.qf-hero__meta span b { color: var(--fg-0); font-weight: 500; }

.qf-hero__cta {
  display: inline-flex; gap: 12px; margin-top: 36px; flex-wrap: wrap;
}

/* code block visual on the right side of hero */
.qf-hero__code {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--fg-1);
  padding: 14px 0;
  overflow: hidden;
}
.qf-hero__code::before {
  content: "qilinfish@studio:~";
  display: block;
  padding: 6px 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  margin-bottom: 6px;
}
.qf-hero__code .ln {
  display: grid;
  grid-template-columns: 44px 1fr;
  padding: 0 14px;
}
.qf-hero__code .ln .n { color: var(--fg-3); user-select: none; }
.qf-hero__code .kw  { color: oklch(0.78 0.10 252); }
.qf-hero__code .fn  { color: oklch(0.85 0.06 90); }
.qf-hero__code .str { color: oklch(0.78 0.10 145); }
.qf-hero__code .com { color: var(--fg-3); font-style: italic; }
.qf-hero__code .pn  { color: var(--fg-2); }

/* ============================================================
   Buttons
   ============================================================ */
.qf-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-0);
  transition: all var(--t-fast);
}
.qf-btn:hover {
  background: var(--bg-2);
  border-color: var(--accent-line);
  color: var(--accent);
}
.qf-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06060a;
}
.qf-btn--primary:hover {
  background: oklch(0.65 0.12 252);
  border-color: oklch(0.65 0.12 252);
  color: #06060a;
}
.qf-btn .arr {
  font-family: var(--font-mono);
  transition: transform var(--t-fast);
}
.qf-btn:hover .arr { transform: translateX(3px); }

/* ============================================================
   Cards (capabilities, products)
   ============================================================ */
.qf-grid {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.qf-grid--3 { grid-template-columns: repeat(3, 1fr); }
.qf-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .qf-grid--3, .qf-grid--2 { grid-template-columns: 1fr; }
}

.qf-card {
  position: relative;
  background: var(--bg-1);
  padding: 32px 28px;
  transition: background var(--t-fast);
}
.qf-card:hover { background: var(--bg-2); }
.qf-card__index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.16em;
  display: flex; justify-content: space-between;
}
.qf-card__title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 18px 0 4px;
  color: var(--fg-0);
}
.qf-card__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.08em;
}
.qf-card__desc {
  margin-top: 16px;
  color: var(--fg-1);
  font-size: 14.5px;
}
.qf-card__list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.qf-card__list li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-1);
  padding: 4px 0 4px 18px;
  position: relative;
  letter-spacing: 0.02em;
}
.qf-card__list li::before {
  content: "›";
  position: absolute; left: 0; top: 4px;
  color: var(--accent);
}

/* status pill */
.qf-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  border: 1px solid var(--line);
  text-transform: uppercase;
}
.qf-status--available { color: var(--accent); border-color: var(--accent-line); }
.qf-status--coming    { color: var(--warn); border-color: oklch(0.72 0.14 75 / 0.45); }
.qf-status--custom    { color: var(--fg-1); }
.qf-status .blip {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

/* tabs (products page) */
.qf-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 32px 0 0;
}
.qf-tabs button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fg-2);
  text-transform: uppercase;
}
.qf-tabs button:hover { color: var(--fg-0); }
.qf-tabs button.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.qf-tabs button .count {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: var(--fg-3);
}

/* product demo gallery */
.qf-demo-gallery {
  margin-top: 36px;
}
.qf-demo-gallery__group {
  margin-top: 34px;
}
.qf-demo-gallery__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.qf-demo-gallery__title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--fg-0);
  letter-spacing: 0.01em;
}
.qf-demo-gallery__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.qf-demo-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.qf-demo-shot {
  background: var(--bg-1);
  border: 1px solid var(--line);
  overflow: hidden;
}
.qf-demo-shot__media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  cursor: zoom-in;
  transition: filter var(--t-fast), border-color var(--t-fast);
}
.qf-demo-shot__media:hover {
  filter: brightness(1.08);
}
.qf-demo-shot__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qf-demo-shot__body {
  padding: 16px 18px 18px;
}
.qf-demo-shot__title {
  margin: 0;
  color: var(--fg-0);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}
.qf-demo-shot__desc {
  margin: 8px 0 0;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .qf-demo-gallery__head { display: block; }
  .qf-demo-gallery__meta {
    display: block;
    margin-top: 6px;
    white-space: normal;
  }
  .qf-demo-gallery__grid { grid-template-columns: 1fr; }
  .qf-demo-shot__media { height: 150px; }
}

/* ============================================================
   Contact
   ============================================================ */
.qf-contact {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin-top: 40px;
}
@media (max-width: 900px) { .qf-contact { grid-template-columns: 1fr; } }

.qf-contact__info,
.qf-contact__form {
  background: var(--bg-1);
  padding: 36px 32px;
}
.qf-contact__row {
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.qf-contact__row:last-child { border-bottom: none; }
.qf-contact__row .k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.qf-contact__row .v {
  margin-top: 4px;
  font-size: 15px;
  color: var(--fg-0);
}

.qf-field {
  display: flex; flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.qf-field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  text-transform: uppercase;
}
.qf-field input,
.qf-field textarea {
  background: var(--bg-0);
  border: 1px solid var(--line);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.qf-field input:focus,
.qf-field textarea:focus {
  border-color: var(--accent-line);
  background: var(--bg-1);
}
.qf-field.is-invalid input,
.qf-field.is-invalid textarea {
  border-color: oklch(0.65 0.18 25);
}
.qf-field__err {
  font-family: var(--font-mono);
  font-size: 11px;
  color: oklch(0.78 0.16 25);
  display: none;
}
.qf-field.is-invalid .qf-field__err { display: block; }

.qf-form-status {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  display: none;
}
.qf-form-status.ok    { display: block; color: var(--accent);  border-color: var(--accent-line); }
.qf-form-status.err   { display: block; color: oklch(0.78 0.16 25); border-color: oklch(0.78 0.16 25 / 0.45); }

/* ============================================================
   Resources / cases lists
   ============================================================ */
.qf-list {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.qf-list a, .qf-list__item {
  display: grid;
  grid-template-columns: 80px 1fr 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast);
}
.qf-list a:hover { background: var(--bg-1); color: var(--fg-0); }
.qf-list .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.16em;
}
.qf-list .label { font-size: 17px; color: var(--fg-0); }
.qf-list .desc  { color: var(--fg-2); font-size: 13px; }
.qf-list .arr {
  font-family: var(--font-mono);
  color: var(--fg-3);
}
.qf-list a:hover .arr { color: var(--accent); transform: translateX(4px); }
@media (max-width: 900px) {
  .qf-list a, .qf-list__item { grid-template-columns: 1fr; gap: 6px; }
}

.qf-empty {
  margin-top: 40px;
  border: 1px dashed var(--line);
  padding: 80px 32px;
  text-align: center;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 13px;
}
.qf-empty .glyph {
  display: block; margin: 0 auto 16px;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  position: relative;
}
.qf-empty .glyph::after {
  content: ""; position: absolute; inset: 8px;
  background: linear-gradient(135deg, transparent 47%, var(--fg-3) 47% 53%, transparent 53%);
}

/* ============================================================
   Footer
   ============================================================ */
.qf-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 40px;
}
.qf-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}
.qf-footer .right { color: var(--fg-2); }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.8,.2,1);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
