/* Reset & Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: #000; color: #eee;
  font-family: "Open Sans", "Noto Sans KR", Arial, sans-serif;
  font-weight: 300;
  line-height: 1.5;
}

/* CSS Vars */
:root{
  --left-gutter: calc(100% / 12); /* 1/12 left margin */
  --right-gutter: calc(100% / 6);  /* 1/6 right margin */
  --tri-font-size: clamp(16px, 1.6vw, 20px);
  --tri-top-margin: clamp(32px, 8vh, 96px);
  --tri-strong-gap: 0.4em; /* space under first line */
  --card-gap: clamp(12px, 1.4vw, 24px);
  --card-min-h: 220px; /* base card height for bxt/services/methods/sequence/contacts */
  --card-radius: 16px;
  --muted: #9aa1a9;
  --soft: #151515;
  --softer: #0d0d0d;
}

/* Shared section scaffold */
section { position: relative; width: 100%; background: transparent; }

/* Relaxed vertical spacing for non-hero sections */
section:not(.hero){ padding: 12vh 0; }

/* Image protection & scaling */
img { -webkit-user-drag: none; user-select: none; }
.card img, .hero .logo { pointer-events: none; display:block; margin-left:2%; }

/* Image within cards display */
.img_m {object-fit: scale-down; width: 25%; margin-top: 20px; margin-bottom: 20px;
}
.img_s {object-fit: scale-down; width: 50%; margin-top: 20px; margin-bottom: 20px;
}
.img_p {object-fit: scale-down; width: min(720px, 92%); margin-top: 20px; margin-bottom: 20px;
}

/* Custom bullets using ‣ (‣) */
.bullets{ list-style: none; margin: 0; padding-left: 1.2em; color:#cfcfcf; font-size: clamp(13px, 1.2vw, 15px) }
.bullets li{ margin: .2em 0; }
.bullets li::before{ content: "‣"; display: inline-block; width: 1em; margin-left: -1.2em; }

/* Title & Backtitle (full-bleed video) */
.hero {
  min-height: 100vh;
  display: grid; place-items: stretch;
  overflow: hidden;
}
.hero video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(0.6);
}
.hero::after{ /* subtle vignette */
  content:""; position:absolute; inset:0;
  background: radial-gradient(120% 120% at 50% 60%, transparent, rgba(0,0,0,.6));
  pointer-events: none;
}
.hero .content {
  position: relative;
  /* Desktop: left edge at 20%, width 40% (i.e., spans from 20% to 60%) */
  left: 18%; width: 40%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; text-align: center;
  margin-top: auto; margin-bottom: auto;
  padding: clamp(12px, 2vw, 24px);
}
.hero .logo {
  width: clamp(120px, 18vw, 240px);
  height: auto;
  display: block;
}
.hero .t1, .hero .t2, .hero .t3 { margin: 0; }
.hero .t1 { font-size: clamp(40px, 5vw, 44px); line-height: 1.25; }
.hero .t2 { font-size: clamp(20px, 2.6vw, 24px); line-height: 1.25; }
.hero .t3 { font-weight: 700; font-size: clamp(14px, 1.6vw, 16px); line-height: 1.05; }
.hero .scroll-down {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%);
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 999px; border:1px solid #444; background: rgba(0,0,0,.4);
  text-decoration: none; color: #ddd;
  transition: transform .2s ease, background .2s ease, border .2s ease;
}
.hero .scroll-down:hover { transform: translateX(-50%) translateY(2px); background:#111; border-color:#666; }
.hero .scroll-icon { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid #ddd; }
.hero .scroll-up .scroll-icon { border-bottom: 12px solid #ddd; border-top: 0; }

/* 1/12 left margin + 1/6 right spacing content band */
.band { width: calc(100% - var(--left-gutter) - var(--right-gutter)); margin-left: var(--left-gutter); }

/* Three-line heading block */
.tri { margin-top: var(--tri-top-margin); margin-bottom: clamp(16px, 2.5vh, 32px); }
.tri p { margin: 0; font-size: var(--tri-font-size); color: #e6e6e6; }
.tri p:nth-child(1) { font-weight: 800; letter-spacing: .2px; margin-bottom: var(--tri-strong-gap); }
.tri p:nth-child(2), .tri p:nth-child(3) { font-weight: 400; color: #c9c9c9; }

/* Card grids */
.cards { display: grid; gap: var(--card-gap); margin-top: clamp(16px, 2vh, 24px); margin-bottom: clamp(32px, 6vh, 64px); }
/* bxt / sequence / contacts: 3 across */
.cards-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
/* services / methods: 2 x 2 (same card size as .cards-3) */
.cards-2x2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
/* practices: vertical stack of big cards */
.cards-practices { grid-template-columns: 1fr; }

/* Card visual */
.card {
  min-height: var(--card-min-h);
  background: linear-gradient(180deg, var(--soft), var(--softer));
  border: 1px solid #1e1e1e; border-radius: var(--card-radius);
  padding: clamp(14px, 1.6vw, 24px);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  display: grid; align-content: start; gap: .5rem;
}
.card .label { font-size: clamp(12px, 1.1vw, 14px); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.card h4 { margin: 0 0 .25rem 0; font-size: clamp(16px, 1.6vw, 20px); }
.card p { margin: 0; color:#cfcfcf; font-size: clamp(13px, 1.2vw, 15px); }

/* Practices big cards */
.practices .card { min-height: 0; gap: 0; }

/* Practices: reconstructed timeline (icon + text) */
.case-pill {
  justify-self: start; order: -1;
  background: #fff; color: #111;
  font-weight: 700; line-height: 1;
  font-size: clamp(14px, 1.4vw, 17px);
  padding: .5em 1rem; border-radius: 999px;
  margin: 0 0 .7rem;
}
/* indent client label so it lines up with the "C" of the Case pill text */
.practices .card .label { margin: 0 0 1.6rem 1rem; }
.steps {
  --icon-col: clamp(40px, 4vw, 52px);
  --step-gap: clamp(22px, 3vh, 40px);
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--step-gap);
}
.step {
  display: grid;
  grid-template-columns: var(--icon-col) 1fr;
  column-gap: clamp(16px, 1.8vw, 28px);
  position: relative;
}
.step-icon { position: relative; }
.step-icon img { width: var(--icon-col); height: var(--icon-col); display: block; margin: 0; }
/* connector: continuous white down-arrow (stem + solid arrowhead that meet) */
.step:not(:last-child) .step-icon::before {
  content: ""; position: absolute;
  left: calc(var(--icon-col) / 2 - 1px);
  top: calc(var(--icon-col) + 4px);
  height: calc(100% + var(--step-gap) - var(--icon-col) - 19px);
  width: 2px; background: #fff;
}
.step:not(:last-child) .step-icon::after {
  content: ""; position: absolute;
  left: calc(var(--icon-col) / 2 - 6px);
  top: calc(100% + var(--step-gap) - 15px);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid #fff;
}
.step-body h5 {
  margin: 0 0 .35rem 0;
  font-size: clamp(15px, 1.5vw, 19px); font-weight: 700; color: #fff;
}
.step-body .bullets { color: #d4d4d4; }

/* Footer */
footer { border-top: 1px solid #1a1a1a; color: #9aa1a9; font-size: 12px; padding: 20px var(--left-gutter) 40px var(--left-gutter); }

/* Mobile */
@media (max-width: 900px) {
  .hero .content { left: 5%; width: 90%; }
  .cards-3, .cards-2x2, .cards-practices { grid-template-columns: 1fr; }
  :root { --left-gutter: 6vw; --right-gutter: 6vw; }
}

/* Focus ring */
a:focus-visible, button:focus-visible { outline: 2px dashed #888; outline-offset: 2px; }

/* ============ /apps — login gate + project list ============ */
.apps-body { min-height: 100vh; }

/* Login gate */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  position: relative;
  width: min(360px, 92vw);
  background: linear-gradient(180deg, var(--soft), var(--softer));
  border: 1px solid #1e1e1e; border-radius: var(--card-radius);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  display: grid; gap: .9rem; text-align: center;
}
/* Logo + title row — logo to the left of the title, like the launcher header */
.login-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-head img { height: 24px; width: auto; display: block; }
.login-card h1 { margin: 0; font-size: clamp(28px, 4vw, 34px); font-weight: 800; color: #fff; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #2a2a2a; background: #0a0a0a; color: #eee;
  font: inherit; font-size: 16px;
}
.login-card input:focus { outline: none; border-color: #666; }
.login-card button {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #2a2a2a; background: #fff; color: #000;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.login-card button:hover { background: #e6e6e6; }
.login-card button:active { transform: translateY(1px); }
.login-error { color: #ff8a8a !important; }

/* Top bar — logo + title, matching the Travel/Weather app headers */
.apps-top {
  display: flex; align-items: center; gap: 12px;
  margin-top: var(--tri-top-margin); margin-bottom: clamp(18px, 3vh, 36px);
}
.apps-home {
  flex: 0 0 auto; display: inline-grid; place-items: center;
  height: 40px; padding: 0 8px; border-radius: 10px; text-decoration: none;
}
.apps-home img { height: 20px; width: auto; display: block; }
.apps-home:hover { background: var(--soft); }
.apps-title {
  margin: 0; font-family: "Open Sans", "Noto Sans KR", sans-serif;
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; letter-spacing: .2px; color: #fff;
}

/* Project list */
.apps-main { padding-bottom: 12vh; }
.app-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
/* Icon on the left, title + description stacked to its right; compact height. */
.app-card {
  text-decoration: none; color: inherit;
  min-height: auto;
  padding: clamp(12px, 1.4vw, 18px);
  grid-template-columns: auto 1fr;
  align-content: center; align-items: center;
  column-gap: 14px; row-gap: .15rem;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.app-card:hover { transform: translateY(-3px); border-color: #3a3a3a; box-shadow: 0 8px 28px rgba(0,0,0,.5); }
/* App mark: --mark is set per card from projects.json; masked so it takes `color`. */
.app-card-icon {
  grid-column: 1; grid-row: 1 / span 2; align-self: center;
  width: 40px; height: 40px; margin: 0;
  background-color: #fff;
  -webkit-mask: var(--mark) no-repeat center / contain;
          mask: var(--mark) no-repeat center / contain;
}
.app-card h4 { grid-column: 2; margin: 0; font-size: clamp(17px, 1.7vw, 21px); font-weight: 700; color: #fff; }
.app-card p { grid-column: 2; margin: 0; color: #c9c9c9; font-size: clamp(13px, 1.2vw, 15px); }
.app-loading { color: var(--muted); }

@media (max-width: 900px) {
  .app-grid { grid-template-columns: 1fr; }
}
