/* =========================================================
   PRECON ICT R&D — 공통 스타일
   ========================================================= */
:root {
  --ink-0: #05080F;
  --ink-1: #0A0F1C;
  --ink-2: #0E1424;
  --ink-3: #131A2D;
  --ink-4: #1A2238;
  --line: rgba(192, 199, 209, 0.10);
  --line-2: rgba(192, 199, 209, 0.20);
  --silver-0: #E6EAF2;
  --silver-1: #C0C7D1;
  --silver-2: #8A93A3;
  --silver-3: #5A6478;
  --accent: #6FA8FF;      /* 연구 1: 축사 환경제어·데이터 */
  --accent-2: #3D7BFF;
  --solar: #FFB454;       /* 연구 2: 태양에너지 */
  --solar-2: #F08A24;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--ink-1);
  color: var(--silver-0);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: rgba(111, 168, 255, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.mono { font-family: var(--mono); }
.muted { color: var(--silver-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--ink-0); font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: rgba(10, 15, 28, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { width: 24px; height: 24px; position: relative; border: 1px solid var(--silver-1); transform: rotate(45deg); }
.brand-mark::before { content: ""; position: absolute; inset: 4px; background: var(--silver-1); }
.brand-mark::after { content: ""; position: absolute; inset: 9px; background: var(--accent); }
.brand-name { font-weight: 700; letter-spacing: 0.18em; font-size: 14px; }
.brand-name small { margin-left: 8px; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.18em; color: var(--silver-2); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; font-size: 14px; color: var(--silver-1); transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--silver-0); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }
.nav-links .nav-cta { margin-left: 10px; border: 1px solid var(--line-2); color: var(--silver-0); display: inline-flex; align-items: center; gap: 8px; }
.nav-links .nav-cta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.nav-links .nav-cta:hover { background: var(--silver-0); color: var(--ink-0); }
.nav-toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 20px; height: 1.5px; background: var(--silver-0); position: relative; transition: transform .25s, background .25s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav.open .nav-toggle span { background: transparent; }
.nav.open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px var(--gutter) 32px;
    background: var(--ink-1); border-top: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .2s;
  }
  .nav.open .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 18px 4px; font-size: 18px; border-bottom: 1px solid var(--line); }
  .nav-links a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  .nav-links .nav-cta { margin: 20px 0 0; justify-content: center; border: 1px solid var(--line-2); }
}

/* ---------- Buttons / tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 22px; min-height: 48px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
  border: 1px solid var(--line-2); color: var(--silver-0);
  transition: background .25s, color .25s, border-color .25s;
}
.btn::after { content: ""; width: 14px; height: 1px; background: currentColor; transition: width .25s; }
.btn:hover::after { width: 22px; }
.btn:hover { background: var(--silver-0); color: var(--ink-0); border-color: var(--silver-0); }
.btn.primary { background: linear-gradient(180deg, #2A4FA0, #1B3A82); border-color: #2A4FA0; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 12px 30px rgba(27,58,130,.35); }
.btn.solar { background: linear-gradient(180deg, #B4661A, #8A4A10); border-color: #B4661A; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 12px 30px rgba(138,74,16,.35); }
.btn.primary:hover, .btn.solar:hover { background: var(--silver-0); color: var(--ink-0); border-color: var(--silver-0); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--silver-2);
}
.tag::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.tag.accent { color: var(--accent); }
.tag.solar { color: var(--solar); }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px;
  border: 1px solid var(--line-2); background: rgba(192,199,209,.04);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--silver-1);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s ease-out infinite; }
.pill.solar .dot { background: var(--solar); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(111,168,255,.55); } 70% { box-shadow: 0 0 0 10px rgba(111,168,255,0); } 100% { box-shadow: 0 0 0 0 rgba(111,168,255,0); } }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); position: relative; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head .lhs { max-width: 720px; }
.sec-head h2 { margin-top: 18px; font-size: clamp(30px, 4.2vw, 52px); }
.sec-head .rhs { max-width: 380px; color: var(--silver-2); font-size: 15px; }
@media (max-width: 880px) { .sec-head { flex-direction: column; align-items: flex-start; gap: 16px; } }

.lead { color: var(--silver-1); font-size: clamp(16px, 1.6vw, 18px); line-height: 1.75; }
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

/* split layout */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.split.rev > :first-child { order: 2; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } .split.rev > :first-child { order: 0; } }

/* framed media */
.figure { position: relative; border: 1px solid var(--line-2); background: var(--ink-2); overflow: hidden; margin: 0; }
.figure img { width: 100%; height: 100%; object-fit: cover; }
.figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--silver-1);
  background: linear-gradient(transparent, rgba(5,8,15,.85));
}
.figure.light { background: #fff; }
.figure.light figcaption { position: static; background: var(--ink-2); border-top: 1px solid var(--line); color: var(--silver-2); }
.figure.contain { display: flex; align-items: center; justify-content: center; padding: 28px; }
.figure.contain img { object-fit: contain; width: auto; max-height: 520px; }

/* bordered cell grid */
.cells { display: grid; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cells > * { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cells.c2 { grid-template-columns: repeat(2, 1fr); }
.cells.c3 { grid-template-columns: repeat(3, 1fr); }
.cells.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cells.c4 { grid-template-columns: repeat(2, 1fr); } .cells.c3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cells.c2, .cells.c4 { grid-template-columns: 1fr; } }

.cell { padding: clamp(24px, 3vw, 36px); background: linear-gradient(180deg, rgba(192,199,209,.02), transparent); transition: background .3s; }
a.cell:hover { background: rgba(111,168,255,.05); }
.cell .cell-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--silver-2); }
.cell h3 { margin-top: 20px; font-size: clamp(20px, 2vw, 24px); }
.cell p { margin-top: 12px; color: var(--silver-1); font-size: 15px; }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.lg { width: 32px; height: 32px; }

/* list rows */
.rows { border-top: 1px solid var(--line); }
.rows li { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rows .k { flex: 0 0 88px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--silver-2); padding-top: 3px; }
.rows .k.accent { color: var(--accent); }
.rows .k.solar { color: var(--solar); }
.rows .v { color: var(--silver-0); font-size: 15px; }
.rows .v small { display: block; color: var(--silver-2); font-size: 13px; margin-top: 2px; }

/* spec table */
.spec { width: 100%; border-collapse: collapse; }
.spec th, .spec td { padding: 16px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { width: 34%; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.18em; color: var(--silver-2); padding-top: 19px; }
.spec td { font-size: 15px; }

/* page hero (sub pages) */
.page-hero { position: relative; padding: calc(var(--nav-h) + clamp(64px, 9vw, 120px)) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.page-hero h1 { margin-top: 24px; font-size: clamp(38px, 6.4vw, 88px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; }
.page-hero .lead { margin-top: 28px; max-width: 640px; }
.page-hero .btn-row { margin-top: 36px; }
.page-hero .breadcrumb { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--silver-2); }
.page-hero .breadcrumb a:hover { color: var(--silver-0); }

/* sub nav (in-page) */
.subnav { position: sticky; top: var(--nav-h); z-index: 40; background: rgba(10,15,28,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav a { flex-shrink: 0; padding: 14px 14px; font-size: 13px; color: var(--silver-2); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.subnav a:hover { color: var(--silver-0); }
.subnav a.active { color: var(--silver-0); border-color: var(--accent); }
.subnav.solar a.active { border-color: var(--solar); }

/* CTA band */
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(32px, 5vw, 56px); border: 1px solid var(--line-2); background: radial-gradient(600px 300px at 100% 0%, rgba(61,123,255,.14), transparent 70%), var(--ink-2); }
.cta-band.solar { background: radial-gradient(600px 300px at 100% 0%, rgba(255,180,84,.14), transparent 70%), var(--ink-2); }
.cta-band h2 { font-size: clamp(24px, 3vw, 36px); }
.cta-band p { margin-top: 10px; color: var(--silver-1); }
@media (max-width: 760px) { .cta-band { flex-direction: column; align-items: flex-start; } }

/* note */
.note { font-size: 13px; color: var(--silver-2); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--ink-0); padding: 56px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.footer h4 { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--silver-2); margin-bottom: 16px; }
.footer-brand { font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.footer-brand small { display: block; margin-top: 12px; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.2em; color: var(--silver-2); text-transform: uppercase; }
.footer ul li { padding: 4px 0; font-size: 14px; color: var(--silver-1); }
.footer ul a:hover { color: var(--silver-0); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--silver-3); }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(5,8,15,.92); backdrop-filter: blur(6px); }
.modal.open { display: flex; }
.modal figure { margin: 0; max-width: 1000px; width: 100%; }
.modal img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; border: 1px solid var(--line-2); }
.modal figcaption { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--silver-2); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 1px solid var(--line-2); font-size: 22px; color: var(--silver-1); }
.modal-close:hover { color: var(--silver-0); border-color: var(--silver-1); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
