/* ArchSeed Soft — 회사 홈 (한국어·영어 공용)
   콘셉트: 세계(배경 그림)의 빛줄기가 근원의 씨앗으로 모이고, 씨앗에서 ArchSeed가 깨어나 게임 / 웹·앱 궤도를 돈다 */
:root {
  color-scheme: dark;
  --night: #050e20;
  --deep: #081529;
  --surface: #0c1a31;
  --surface-2: #11223d;
  --line: #ffffff1c;
  --line-strong: #ffffff33;
  --ink: #f5f1e6;
  --muted: #aab5c4;
  --gold: #e8bd74;
  --gold-2: #ffe2a3;
  --gold-d: #a8803f;
  --teal: #5fe3d0;
  --teal-d: #2a9f92;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  font: 16px/1.7 var(--sans);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; background: var(--night); }
body { margin: 0; background: var(--night); color: var(--ink); word-break: keep-all; overflow-wrap: break-word; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; border-radius: 4px; }
.wrap { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -100px; padding: 8px 20px; background: #fff; color: #000; z-index: 10; }
.skip:focus { top: 8px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }

/* ── 헤더 ── */
.site-header { position: relative; z-index: 3; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.identity { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; font: 600 21px/1 var(--serif); letter-spacing: -.02em; }
.identity img { width: 38px; height: auto; }
.identity small { font: 600 12px var(--sans); color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.site-header nav { display: flex; gap: clamp(14px, 2.6vw, 36px); }
.site-header nav a, .lang { font-size: 14px; font-weight: 600; text-decoration: none; padding-block: 10px; color: #dfe5ee; transition: color .2s; }
.site-header nav a:hover, .lang:hover { color: var(--gold-2); }
.lang { padding-left: 18px; border-left: 1px solid var(--line-strong); }

/* ── 히어로 ── */
.hero { position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse 60% 70% at 72% 62%, #12305a66, transparent 70%), radial-gradient(ellipse 40% 50% at 10% 0%, #1b2a4a55, transparent 70%), var(--night); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(transparent, var(--night)); z-index: -1; }
/* 타이틀 배경: 사용자 제공 판타지 세계 그림 */
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-bg picture { display: block; height: 100%; opacity: 1; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; transform-origin: 50% 45%; }
.hero-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 34% 48% at 50% 46%, #050e2094, transparent 72%), linear-gradient(180deg, #050e2073 0%, transparent 18%, transparent 72%, #050e20cc 100%); }
.hero .wrap { display: grid; justify-items: center; padding-block: clamp(24px, 4vw, 56px) clamp(8px, 2vw, 24px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 히어로 무대: 사용자 제공 로고(엠블럼 + ArchSeed SOFT 워드마크) + 빛 효과 */
.stage { position: relative; justify-self: center; width: min(100%, 680px); aspect-ratio: 560 / 520; }
.stage-fx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emblem-wrap { position: absolute; left: 19%; top: 4%; width: 62%; }
.emblem-img { width: 100%; filter: drop-shadow(0 10px 30px #00000080); }
.emblem-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url(/assets/archseed-emblem.webp) center / 100% 100% no-repeat; mask: url(/assets/archseed-emblem.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 45%, #fff6d880 50%, transparent 55%) 160% 0 / 260% 100% no-repeat; mix-blend-mode: screen; opacity: 0; }
.core-glow { position: absolute; left: 50%; top: 52%; width: 34%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, #8ff5e6cc, #5fe3d055 45%, transparent 75%); mix-blend-mode: screen; opacity: .55; }
.wordmark { position: absolute; left: 12%; top: 67%; width: 76%; filter: drop-shadow(0 2px 6px #050e20) drop-shadow(0 0 18px #050e20b3); }

/* 세계의 빛줄기 층: 배경 그림 위치에 맞춰 JS가 캔버스에 빛 다발로 그린다 (soft.js) */
.world-glow, .world-spark { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
/* 엠블럼 뒤 궤도: 금빛 궤도가 게임 → 웹·앱 노드를 잇고, 혜성이 돈다 */
.orbit-line { fill: none; stroke-width: 1.4; stroke-linecap: round; }
.orbit-glow { fill: none; stroke-width: 9; stroke-linecap: round; opacity: .14; }
.o1 .orbit-glow, .o1 .orbit-line { stroke: url(#g-orbit-gold); }
.o2 .orbit-glow { stroke: var(--teal); opacity: .07; }
.o1 .orbit-line { opacity: .85; }
.orbit-line.thin { stroke-width: .6; opacity: .4; }
.o2 .orbit-line { stroke: var(--teal); }
.o2 .orbit-line:not(.thin) { opacity: .32; }
.o2 .orbit-line.thin { opacity: .18; }
.comet { fill: none; stroke-linecap: round; opacity: 0; }
.comet.c0 { stroke-width: 14; stroke-dasharray: .014 .986; --o: -.15; --a: .2; }
.comet.c1 { stroke-width: 2.2; stroke-dasharray: .16 .84; --o: 0; --a: .28; }
.comet.c2 { stroke-width: 2.6; stroke-dasharray: .06 .94; --o: -.1; --a: .65; }
.comet.c3 { stroke-width: 4.5; stroke-dasharray: .002 .998; --o: -.158; --a: 1; }
.o1 .comet { stroke: #ffe9b8; }
.o2 .comet { stroke: #c8fff6; }
.node .ping { fill: none; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.node.n1 .ping { stroke: var(--gold-2); }
.node.n2 .ping { stroke: #b9fff3; }
.node circle { stroke-width: 2.5; }
.node.n1 circle:not(.ping) { fill: #2a1f0e; stroke: var(--gold); }
.node.n2 circle:not(.ping) { fill: #0b2a2b; stroke: var(--teal); }
.node .icon { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.node.n1 .icon { stroke: var(--gold-2); }
.node.n2 .icon { stroke: #b9fff3; }
.node text { font: 700 23px var(--sans); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #050e20d9; stroke-width: 6px; stroke-linejoin: round; }
.rings circle { fill: none; stroke: var(--teal); stroke-width: 1.5; opacity: 0; }

/* 그리기 모션: pathLength=1 기준 */
.motion .draw { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.fill-box { transform-box: fill-box; transform-origin: center; }

/* ── 공통 섹션 ── */
.catalog { padding-block: clamp(56px, 7vw, 104px) 0; }
#games { padding-top: clamp(16px, 3vw, 48px); }
.section-head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 6px 18px; margin-bottom: 28px; }
.sec-no { font: 400 15px var(--serif); color: var(--muted); padding-bottom: 10px; }
.section-head h2 { margin: 0; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.2; letter-spacing: -.04em; }
.section-head h2 small { display: block; font: 600 13px var(--sans); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
#games .section-head h2 small { color: var(--gold); }
#apps .section-head h2 small { color: var(--teal); }
.sec-count { margin: 0; padding-bottom: 8px; font-size: 14px; color: var(--muted); }
.sec-line { grid-column: 1 / -1; height: 1px; background: var(--line-strong); position: relative; overflow: visible; }
.sec-line::before { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: 120px; border-radius: 3px; background: currentColor; transform-origin: left; }
#games .sec-line { color: var(--gold); }
#apps .sec-line { color: var(--teal); }

.grid { display: grid; gap: clamp(18px, 2vw, 28px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── 프로젝트 카드 (게임 / 웹·앱 공통 규칙) ── */
.card { min-width: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .35s var(--ease-out), border-color .35s, box-shadow .35s; }
.card:hover { transform: translateY(-4px); border-color: #e8bd7455; box-shadow: 0 18px 40px -18px #000c, 0 0 0 1px #e8bd7422; }
#apps .card:hover { border-color: #5fe3d055; box-shadow: 0 18px 40px -18px #000c, 0 0 0 1px #5fe3d022; }
.cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #121c2c; }
.cover > img:first-child { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.card:hover .cover > img:first-child { transform: scale(1.045); }
.cover.monster > img:first-child { object-position: 74% center; }
.cover.monster .logo { position: absolute; width: 72%; bottom: 5%; left: 5%; filter: drop-shadow(0 2px 6px #000); }
.cover.seira > img:first-child { transform: scale(1.18); }
.card:hover .cover.seira > img:first-child { transform: scale(1.23); }
.grid.apps .cover { aspect-ratio: 12 / 5; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--gold-2); background: #e8bd741c; border: 1px solid #e8bd7455; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.dev::before { animation: blink 2.4s ease-in-out infinite; }
.badge.live { color: #8ff5e6; background: #5fe3d01a; border-color: #5fe3d066; }
.kind { font-size: 13px; color: var(--muted); }
.card h3 { margin: 12px 0 6px; font-size: clamp(20px, 1.7vw, 25px); line-height: 1.35; letter-spacing: -.035em; }
.card p { margin: 0; color: var(--muted); }
.state { margin-top: 12px !important; font-size: 13.5px; color: #c9d1dc !important; }
.state b { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 18px; }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 650; text-decoration: none; color: var(--ink); transition: transform .2s var(--ease-out), background .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); background: #ffffff12; border-color: #ffffff55; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1b1408; }
.btn.primary:hover { background: var(--gold-2); }
#apps .btn.primary { background: var(--teal); border-color: var(--teal); color: #04221e; }
#apps .btn.primary:hover { background: #9af7ea; }
.btn small { font-weight: 500; color: var(--muted); }

details { margin-top: 0; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "＋"; font-weight: 700; color: var(--gold); transition: transform .3s var(--ease-out); display: inline-block; }
details[open] summary::before { transform: rotate(45deg); }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; width: 100%; }
details[open] .gallery { animation: unfold .5s var(--ease-out); }
figure { margin: 0; }
figure img { border-radius: 6px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card details { flex-basis: 100%; }

/* StageFlow 표지: 분기형 이야기 흐름 */
.cover.flow { background: radial-gradient(ellipse at 85% 20%, #6c4f9a88, transparent 60%), radial-gradient(ellipse at 10% 100%, #1e5d6a66, transparent 60%), #1d1b33; }
.cover.flow svg { width: 100%; height: 100%; }
.flow .edge { fill: none; stroke: #d6c4f566; stroke-width: 2; }
.flow .pulse { fill: none; stroke: #f3eaff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: .12 .88; stroke-dashoffset: 1; animation: flow 3.2s linear infinite; }
.flow .pulse.p2 { animation-delay: -1.1s; }
.flow .pulse.p3 { animation-delay: -2.1s; }
.flow .pulse.p4 { animation-delay: -.5s; }
.flow rect { fill: #2a2748; stroke: #c9b4ef; stroke-width: 1.5; }
.flow rect.end { fill: #3d2f5c; stroke: var(--gold); }
.flow rect.start { fill: #193b44; stroke: var(--teal); }
.flow text { font: 700 15px var(--sans); fill: #f4eeff; text-anchor: middle; dominant-baseline: middle; }
.flow .title { font: 600 34px var(--serif); text-anchor: start; letter-spacing: -.02em; fill: #fff3eb; }
.card:hover .flow rect { animation: nudge .6s var(--spring); }

/* PawLab 표지 */
.cover.paw { background: #dcefdc; }
.cover.paw > img:first-child { object-position: right center; }
.cover.paw b { position: absolute; left: 7%; top: 50%; translate: 0 -50%; font: 600 clamp(28px, 3.4vw, 50px)/1 var(--serif); color: #264f42; letter-spacing: -.03em; }

/* ── 이름의 뜻 + 회사 소개 ── */
.studio { margin-top: clamp(72px, 9vw, 128px); background: linear-gradient(180deg, var(--night), var(--deep) 30%, var(--deep)); border-top: 1px solid var(--line); }
.studio > .wrap { padding-block: clamp(56px, 7vw, 100px); }
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 80px); }
.about h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.035em; }
.about-logo { width: 1.5em; flex: none; filter: drop-shadow(0 4px 12px #5fe3d033); }
.about p { color: #c3ccd8; margin: 0 0 10px; max-width: 40em; }
.mail { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 700; color: var(--gold); text-decoration: none; border-bottom: 1px solid #e8bd7466; padding-bottom: 4px; overflow-wrap: anywhere; transition: color .2s, border-color .2s; }
.mail:hover { color: var(--gold-2); border-color: var(--gold-2); }
.contacts { margin: 1rem 0 0; }
.contacts > div + div { margin-top: .8rem; }
.contacts dt { font-size: .875rem; color: var(--muted); }
.contacts dd { margin: 0; }
.contacts .mail { margin-top: 2px; }
footer { border-top: 1px solid var(--line); background: var(--deep); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-block: 22px; color: #9aa6b5; font-size: 13px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--gold-2); }

/* ── 모션 ── */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: scale(1); } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-70px) scale(.7); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { opacity: .85; filter: drop-shadow(0 0 4px #5fe3d0aa); } 50% { opacity: 1; filter: drop-shadow(0 0 14px #5fe3d0); } }
@keyframes ring { 0% { opacity: .55; transform: scale(.6); } 100% { opacity: 0; transform: scale(3.4); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes flow { to { stroke-dashoffset: -1; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 50% { transform: translateY(-2px); } }
@keyframes emblem-in { 0% { opacity: 0; transform: translateY(26px) scale(.9); filter: blur(10px) brightness(1.8); } 60% { filter: blur(0) brightness(1.25); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shine { 0% { opacity: 1; background-position: 160% 0; } 22% { opacity: 1; background-position: -60% 0; } 23%, 100% { opacity: 0; background-position: -60% 0; } }
@keyframes core { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: .95; transform: scale(1.12); } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes bg-in { from { opacity: 0; transform: scale(1.14); } to { opacity: 1; transform: scale(1.04); } }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.07) translate(-.5%, -.4%); } }
@keyframes orbit { from { stroke-dashoffset: var(--o); opacity: var(--a); } to { stroke-dashoffset: calc(var(--o) - 1); opacity: var(--a); } }
@keyframes ping { 0% { opacity: .9; transform: scale(1); } 14%, 100% { opacity: 0; transform: scale(1.9); } }

/* 히어로 타임라인 (약 4초): 아치 → 씨앗 → 싹 → 두 갈래 → 노드 */
.motion .halo { opacity: 0; animation: fade 1.6s ease-out .1s forwards; }
.motion .hero-bg img { animation: bg-in 2.6s var(--ease-out) both, drift 26s ease-in-out 2.6s infinite alternate; }
.motion .orbit-line, .motion .orbit-glow { animation: draw 1.4s var(--ease-io) 2s forwards; }
.motion .o2 .orbit-line, .motion .o2 .orbit-glow { animation-delay: 2.35s; }
.motion .o1 .comet { animation: orbit 10s linear 3.4s infinite; }
.motion .o2 .comet { animation: orbit 15s linear 4.2s infinite; }
.motion .node.n1 .ping { animation: ping 10s ease-out 12.15s infinite; }
.motion .node.n2 .ping { animation: ping 10s ease-out 7.15s infinite; }
.motion .emblem-wrap { opacity: 0; animation: emblem-in 1.6s var(--ease-out) 1.2s forwards, hover 7s ease-in-out 3.6s infinite; }
.motion .emblem-wrap::after { animation: shine 7s var(--ease-io) 2.6s infinite; }
.motion .core-glow { opacity: 0; animation: core 3.6s ease-in-out 1.85s infinite; }
.motion .wordmark { clip-path: inset(0 100% 0 0); animation: wipe 1.1s var(--ease-io) 2.2s forwards; }
.motion .node { opacity: 0; animation: pop .7s var(--spring) forwards; }
.motion .node.n1 { animation-delay: 2.1s; }
.motion .node.n2 { animation-delay: 2.75s; }
.motion .rings circle { transform-box: fill-box; transform-origin: center; animation: ring 4.8s ease-out 1.9s infinite; }
.motion .rings circle:nth-child(2) { animation-delay: 3.5s; }
.motion .rings circle:nth-child(3) { animation-delay: 5.1s; }
.hero.paused *, .hero.paused *::after { animation-play-state: paused !important; }

/* 스크롤 등장 (JS가 있을 때만 숨김) */
.motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--i, 0) * .1s); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .reveal .sec-line::before { transform: scaleX(0); transition: transform 1.1s var(--ease-io) .3s; }
.motion .reveal.in .sec-line::before { transform: scaleX(1); }

/* ── 반응형 ── */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 740px) {
  .site-header .wrap { flex-wrap: wrap; gap: 4px 12px; padding-block: 10px 4px; min-height: 0; }
  .identity small { display: none; }
  .site-header nav { order: 3; width: 100%; justify-content: space-between; gap: 8px; }
  .grid, .grid.apps { grid-template-columns: 1fr; }
  .hero .wrap { padding-block: 28px 32px; }
  .hero-bg img { object-position: 50% 50%; }
  .section-head { grid-template-columns: auto 1fr; }
  .sec-count { grid-column: 1 / -1; grid-row: 2; padding: 0; }
  .sec-line { grid-row: 3; }
  .card-body { padding: 18px 18px 20px; }
  .gallery { grid-template-columns: 1fr; }
  .flow .title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .draw { stroke-dashoffset: 0 !important; }
  .rings, .comet, .node .ping { display: none; }
}
