:root {
  --ink: #111111;
  --ink-soft: #444444;
  --link: #1a6b35;
  --paper: #ffffff;
  --mint: #f0f9f4;
  --mint-line: #b2dfcb;
  --forest: #0d3d1f;
  --forest-mid: #1e7a3a;
  --forest-light: #2d8a4e;
  --sans-ko: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif-ko: "Gowun Batang", AppleMyungjo, Batang, serif;
  --sans-en: "Instrument Sans", -apple-system, "Segoe UI", sans-serif;
  --serif-en: Newsreader, Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  font-synthesis: none;
  line-height: 1.5;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 6px;
}

/* Global bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 0 max(16px, calc((100% - 980px) / 2));
  background: var(--forest);
  font-size: 13px;
}

.bar-home { color: #ffffff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.bar-home:hover { color: var(--mint-line); }

.bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switch,
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: none;
  color: #ffffff;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.language-switch:hover,
.share-toggle:hover,
.share-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
}

.language-switch:focus-visible,
.share-toggle:focus-visible,
.share-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 6px;
}

.share-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.share {
  position: relative;
}

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(296px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--mint-line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(13, 61, 31, 0.22);
}

.share-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.share-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.share-list a:hover {
  background: var(--mint);
  color: var(--forest);
}

.share-list svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-footer {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--mint-line);
}

.share-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--mint-line);
  border-radius: 8px;
  background: var(--mint);
  color: var(--forest);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.share-action:hover {
  background: #e1f3e9;
}

.share-action svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

[hidden] { display: none !important; }

/* Opening display */
.hero {
  padding: clamp(40px, 7vh, 72px) 16px;
  background: linear-gradient(145deg, var(--forest) 0%, var(--forest-mid) 55%, var(--forest-light) 100%);
  color: #ffffff;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 80px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.022em;
}

/* The shelf: apps side by side */
.apps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 72px) 24px;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
  text-align: center;
}

.app img {
  display: block;
  width: 120px;
  height: auto;
  filter: drop-shadow(0 16px 16px rgba(13, 61, 31, 0.22));
}

/* The visible artwork spans 206 of 256 px (FileDesk, Image+), 228 of 256 px (KeyStamp), and 224 of 256 px (Office); preserve the 120 px layout slot. */
.app img.app-icon-filedesk,
.app img.app-icon-imageplus { transform: scale(1.242718); }
.app img.app-icon-keystamp { transform: scale(1.122807); }
.app img.app-icon-office { transform: scale(1.142857); }

.app h2 {
  margin: 24px 0 0;
  font-size: clamp(25px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.012em;
}

/* Growing the description lines up the rows below it across columns. */
.app p {
  flex: 1;
  max-width: 21em;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.45;
}

.app a {
  margin-top: 14px;
  color: var(--link);
  font-size: 17px;
  text-decoration: none;
}

.app a:hover { text-decoration: underline; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 14px;
  list-style: none;
}

.platforms li,
.app .platforms a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app .platforms a {
  margin: 0;
  color: var(--link);
  font-size: inherit;
}

.platforms svg { width: 15px; height: 15px; fill: currentColor; }

@media (max-width: 1080px) {
  .apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 48px;
    max-width: 760px;
  }
}

@media (max-width: 620px) {
  .apps {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 24px;
  }

  .app { padding: 40px 0; }
  .app + .app { border-top: 1px solid var(--mint-line); }
}

footer {
  padding: 36px 16px 24px;
  background: var(--forest);
  color: #ffffff;
  text-align: center;
}

footer a { color: #ffffff; text-decoration: none; }

.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  font-size: 15px;
}

.social a:hover { background: rgba(255, 255, 255, 0.14); }

.social svg { width: 16px; height: 16px; fill: currentColor; }

.copyright {
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

/* Fonts follow language: Latin-only text is marked lang="en". */
:lang(ko) { font-family: var(--sans-ko); }
:lang(en) { font-family: var(--sans-en); }
.app p:lang(ko) { font-family: var(--serif-ko); }
.app p:lang(en) { font-family: var(--serif-en); }

/* The single orchestrated moment: apps settle on the shelf */
@media (prefers-reduced-motion: no-preference) {
  .app { animation: settle 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .app:nth-child(2) { animation-delay: 100ms; }
  .app:nth-child(3) { animation-delay: 200ms; }
  .app:nth-child(4) { animation-delay: 300ms; }
  .app:nth-child(5) { animation-delay: 400ms; }
  .app:nth-child(6) { animation-delay: 500ms; }
  .app:nth-child(7) { animation-delay: 600ms; }
  .app:nth-child(8) { animation-delay: 700ms; }
  .app:nth-child(9) { animation-delay: 800ms; }
  .app:nth-child(10) { animation-delay: 900ms; }
  .app:nth-child(11) { animation-delay: 1000ms; }

  @keyframes settle {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
}
