/* KYNN TECHNOLOGY — 「웨이퍼」
   검은 바탕, 흰 글씨, 가운데 워드마크, 상단 탭 4개.
   배경은 사진이 아니라 캔버스로 그린 실리콘 웨이퍼(다이 격자)다. 밝기 7% 안팎.
   토큰: --ink #0a0a0a(바탕) / --paper #f4f4f2(글자) / --mute #9c9c98(보조)
         --line #2a2a2a(선) / --accent #7fa8cc(강조, 선택된 탭 밑줄 한 곳에만)
         --fig #7f8d9d(하는 일 도해 선)
   서체: Pretendard Variable 단일. 워드마크는 대문자 + 넓은 자간. 단일 다크 테마(의도적). */

:root {
  --ink: #0a0a0a;
  --paper: #f4f4f2;
  --mute: #9c9c98;
  --dim: #82827e;
  --line: #2a2a2a;
  --accent: #7fa8cc;
  --fig: #7f8d9d;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--ink); }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--paper);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }
.panel:focus { outline: none; }
::selection { background: var(--paper); color: var(--ink); }

/* 배경: 웨이퍼 캔버스 + 패널 열릴 때 덮는 막 */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity .4s ease, filter .4s ease;
}
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
/* 패널을 열어도 웨이퍼는 첫 화면과 똑같이 보이고 계속 움직인다.
   글자가 뜨는 자리만 아주 옅게 눌러 준다. */
body.is-open .veil { opacity: .22; }

.stage, .foot { position: relative; z-index: 2; }
/* 해시(#about …)로 바로 들어오면 브라우저가 그 섹션을 화면 맨 위로 끌어올린다.
   헤더가 relative면 워드마크와 탭이 통째로 밀려 올라가 돌아오지 않으므로 sticky로 고정한다.
   바탕은 배경 웨이퍼가 비쳐야 하는 첫 화면에서는 투명하게 두고, 패널이 열렸을 때(그리고
   JS가 없어 네 패널이 쌓일 때)만 먹칠한다. */
.top { position: sticky; top: 0; z-index: 3; }
body.is-open .top, html:not(.js) .top { background: var(--ink); }

/* 상단 */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 24px;
  padding: 22px var(--gutter);
  min-height: 72px;
}
.home-link {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  white-space: nowrap;
  color: var(--mute);
  transition: color .18s;
}
.home-link:hover { color: var(--paper); }
.mark { flex: none; overflow: visible; }
.home-text { opacity: 0; transition: opacity .25s ease; }
body.is-open .home-text { opacity: 1; }
html:not(.js) .home-text { opacity: 1; }

.tabs {
  grid-column: 2;
  display: flex;
  gap: clamp(18px, 3.5vw, 44px);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tabs a {
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  color: var(--mute);
  transition: color .15s;
}
.tabs a:hover { color: var(--paper); }
.tabs a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--accent); }

/* 무대 */
.stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter) 48px;
}
.hero { text-align: center; }
/* display:none 이면 문서의 유일한 h1이 접근성 트리에서 사라진다 — 눈에만 안 보이게 한다 */
body.is-open .hero {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.wordmark {
  margin: 0;
  /* 두 번째 항(가용 폭 ÷ 15글자어치)이 ~377px 아래에서만 걸린다.
     그 위(360·390·1440 …)에서는 지금까지의 크기가 그대로다. */
  font-size: min(clamp(24px, 5.3vw, 84px), calc((100vw - 2 * var(--gutter)) / 14.5));
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.16em; /* 마지막 글자 뒤 자간의 절반 — 시각적 중앙 보정 */
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}
/* 글자 조각은 inline 그대로 둔다. inline-block으로 바꾸면 자간·커닝이 달라져
   워드마크 폭이 통째로 늘어나고 좁은 화면에서 넘친다. 그래서 등장은 불투명도만 움직인다. */
.tagline {
  margin: clamp(16px, 2.4vw, 28px) 0 0;
  font-size: clamp(12px, 1.05vw, 14px);
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--mute);
}
.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
}
body.is-open .hint { display: none; }
html:not(.js) .hint { display: none; }

/* 패널 */
.panel {
  width: min(100%, 640px);
  animation: rise .28s ease-out both;
}
.panel[hidden] { display: none; }
.kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mute);
}
.lead {
  margin: 0 0 20px;
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 600;
  line-height: 1.5;
  text-wrap: balance;
}
.panel p { margin: 0 0 16px; }
.sign { color: var(--mute); }

/* 하는 일 — 웨이퍼·부품·장비 도해 (폭은 다른 패널과 같은 640px) */
.figs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3.4vw, 34px);
  margin: 6px 0 26px;
  padding: 0;
}
.figs li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.figs svg {
  display: block;
  width: 100%;
  max-width: 172px;
  height: auto;
  color: var(--fig);
}
.figs span {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 20px; }
.btn {
  display: inline-block;
  padding: 12px 20px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--paper);
  border-radius: 2px;
}
.btn:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--paper); }
/* 아직 열지 않은 링크 자리 — 누를 수 없다는 것이 보이게 둔다.
   공고를 열 때는 이 span을 채용공고 주소를 가진 <a class="btn">로 바꾸면 된다. */
.btn-soon { background: transparent; color: var(--mute); border: 1px dashed var(--line); border-color: #444; cursor: default; user-select: none; }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.email { margin: 20px 0 24px; }
.email a {
  font-size: clamp(20px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}
.back {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--mute);
  border-bottom: 1px solid var(--line);
}
.back:hover { color: var(--paper); border-bottom-color: var(--paper); }

/* 하단 */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter) 22px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--mute);
}
.foot a:hover { color: var(--paper); }

/* 등장: 워드마크가 글자 단위로, 그 뒤를 태그라인·탭·힌트가 따라온다.
   진행은 script.js가 직접 그린다(합성기 시계에 기대지 않는다).
   JS가 멈추면 html에 .anim이 붙지 않으므로 아래 폴백이 그냥 보여준다. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes reveal { to { opacity: 1; } }

html.js .wordmark,
html.js .mark,
html.js .tagline,
html.js .tabs a,
html.js .hint { opacity: 0; }
html.js .wordmark .ch { opacity: 0; }

html.js:not(.anim) .wordmark,
html.js:not(.anim) .mark,
html.js:not(.anim) .tagline,
html.js:not(.anim) .tabs a,
html.js:not(.anim) .hint { animation: reveal .35s ease-out 100ms forwards; }
html.js:not(.anim) .wordmark .ch { opacity: 1; }

/* JS 없을 때: 워드마크 아래에 네 섹션을 차례로 보여준다 */
html:not(.js) .panel { display: block; margin-top: 48px; }
html:not(.js) .stage { align-content: start; grid-auto-rows: max-content; padding-top: 64px; }

@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; }
  .tabs a, .home-link, .home-text, .bg, .veil { transition: none; }
  html.js .wordmark, html.js .wordmark .ch, html.js .mark,
  html.js .tagline, html.js .tabs a, html.js .hint,
  html.js:not(.anim) .wordmark, html.js:not(.anim) .wordmark .ch,
  html.js:not(.anim) .mark, html.js:not(.anim) .tagline,
  html.js:not(.anim) .tabs a, html.js:not(.anim) .hint {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* 가로 한 줄 헤더는 720px 아래에서 워드마크와 탭이 붙는다 — 그 전에 세로로 쌓는다 */
@media (max-width: 720px) {
  .top { grid-template-columns: 1fr; justify-items: center; row-gap: 12px; padding-top: 18px; }
  .home-link { grid-column: 1; justify-self: center; }
  .tabs { grid-column: 1; }
}

@media (max-width: 600px) {
  .tabs { font-size: 14px; }
  .wordmark { letter-spacing: 0.22em; text-indent: 0.11em; }
  .tagline { font-size: 11.5px; letter-spacing: 0.12em; }
  .hint { font-size: 10.5px; letter-spacing: 0.1em; }
  .foot { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
}
