* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --text: #111111;
  --muted: #5d5d5d;
  --line: #e6e6e6;
  --accent: #2f6fed;
  --code: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", "Liberation Mono",
    "Courier New", monospace;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  scrollbar-width: none;
  -ms-overflow-style: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #ffffff 0%, #f7f8fb 85%);
  line-height: 1.6;
}

body::-webkit-scrollbar {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

a:hover {
  border-bottom-color: var(--text);
}

/* Default corner radius (never unrounded). Simple value so Chrome applies it. */
.window {
  --inset-t: env(safe-area-inset-top, 0px);
  --inset-b: env(safe-area-inset-bottom, 0px);
  --inset-l: env(safe-area-inset-left, 0px);
  --inset-r: env(safe-area-inset-right, 0px);
  max-width: 980px;
  margin: 48px auto 56px;
  margin-top: max(48px, var(--inset-t));
  margin-bottom: max(56px, var(--inset-b));
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition: height 0.3s ease;
}

/* macOS dock–style restore: minimized window thumbnail */
.window-restore {
  display: none;
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  min-width: 180px;
}

.window-restore.is-visible {
  display: block;
}

.window-restore:hover {
  transform: translateX(-50%) scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.window-restore:active {
  transform: translateX(-50%) scale(0.98);
}

.window-restore-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-width: 140px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--code);
  font-size: 11px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(250, 250, 250, 0.92) 0%, rgba(244, 245, 247, 0.92) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 12px;
  font-variant-ligatures: none;
}

.window-restore-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.window-restore-dots .dot {
  width: 6px;
  height: 6px;
}

.window-restore-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--code);
  font-size: 13px;
  color: var(--muted);
  background: linear-gradient(90deg, #fafafa 0%, #f4f5f7 100%);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dot:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.dot-red {
  background: #ff5f57;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #28c840;
}

.window-title {
  margin-left: auto;
  font-variant-ligatures: none;
}

.page {
  padding: 56px 32px 0;
}

.hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 40px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: nowrap;
}

.hero-text {
  flex: 1 1 420px;
}

.hero-image {
  flex: 0 0 240px;
  display: flex;
  justify-content: flex-end;
}

.hero-image-mobile {
  display: none;
}

.hero-image img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
  transition: box-shadow 0.3s ease, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  will-change: transform;
}

.hero-image img:hover {
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.terminal-line {
  font-family: var(--code);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
  min-height: 1.2em;
}

.terminal-line.typing-complete::after {
  content: "▋";
  animation: blink 1s infinite;
  margin-left: 2px;
  opacity: 1;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.prompt {
  color: var(--text);
  margin-right: 6px;
}

h1 {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.tagline {
  color: var(--muted);
  max-width: 520px;
}

.chip-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--code);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(47, 111, 237, 0.15), 0 0 0 1px rgba(47, 111, 237, 0.05);
  color: var(--text);
  border-bottom-color: var(--line);
}

.editor {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f8f8fa;
  font-family: var(--code);
}

.editor-bar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #f1f2f5;
  color: var(--muted);
  font-size: 12px;
}

.editor-tabs {
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.editor-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  background: #e9ebf0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--code);
  padding: 6px 12px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: var(--text);
  background: #eff1f4;
}

.tab-button.is-active {
  border-color: var(--line);
  border-bottom-color: #ffffff;
  background: #ffffff;
  color: var(--text);
}

.project-panel {
  display: none;
}

.project-panel.is-active {
  display: block;
}

.editor-code-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.editor-code {
  list-style: none;
  counter-reset: line;
  padding: 14px 16px 8px 16px;
  font-size: 13px;
  color: #1f2937;
  min-width: min-content;
}

.editor-code li {
  counter-increment: line;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 2px 0;
  align-items: start;
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.editor-code li:hover {
  background: rgba(47, 111, 237, 0.03);
  border-radius: 4px;
}

.editor-code li::before {
  content: counter(line);
  color: #9ca3af;
  text-align: right;
  font-variant-ligatures: none;
}

.editor-code .line-content {
  display: block;
  white-space: pre;
  min-height: 1.2em;
}

/* Xcode Light–style Swift syntax highlighting */
.editor-code .token-keyword {
  color: #ad3da4;
}

.editor-code .token-type {
  color: #3f6e75;
}

.editor-code .token-property {
  color: #272ad8;
}

.editor-code .token-string {
  color: #d12f1b;
}

.editor-code .token-number {
  color: #272ad8;
}

.editor-code .token-label {
  color: #000000;
}

.editor-code .token-enum {
  color: #3f6e75;
}

.editor-output {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  background: #f5f6f8;
}

.output-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.output-line {
  color: var(--text);
}

.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
  font-family: var(--code);
}

p + p {
  margin-top: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 10px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.card-title {
  font-weight: 600;
  margin-bottom: 8px;
}


.card-body {
  color: var(--muted);
  font-size: 15px;
}

.community-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.community-card {
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 10px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.community-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.community-card-title {
  font-weight: 600;
  flex: 1;
  min-width: 200px;
}

.community-card-date {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--code);
  white-space: nowrap;
}

.community-card-body {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline-meta {
  font-weight: 600;
}

.timeline-sub {
  color: var(--muted);
  margin-top: 4px;
}

.timeline-body {
  margin-top: 10px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .window {
    margin: 24px 16px 40px;
    margin-top: max(24px, var(--inset-t));
    margin-bottom: max(40px, var(--inset-b));
    margin-left: max(16px, var(--inset-l));
    margin-right: max(16px, var(--inset-r));
    border-radius: 18px;
  }

  .page {
    padding: 48px 20px 0;
  }

  .section:last-of-type {
    padding-bottom: 40px;
  }

  .editor-code li {
    grid-template-columns: 22px 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .hero-top {
    flex-direction: column;
    flex-wrap: wrap;
  }

  .hero-image {
    display: none;
  }

  .hero-image-mobile {
    display: flex;
    justify-content: flex-start;
    margin: 16px 0 20px;
  }

  .hero-image-mobile img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
    transition: box-shadow 0.3s ease, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    will-change: transform;
  }

  .hero-image-mobile img:hover {
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  }

  /* Community cards: stack title and date on small screens */
  .community-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 12px;
  }

  .community-card-title {
    min-width: unset;
  }

  .community-card-date {
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
