:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b6473;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --border: #e5e7eb;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  --fade-bg: rgba(245, 246, 248, 0);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0f1a;
    --card: #121826;
    --text: #f8fafc;
    --muted: #9aa4b2;
    --accent: #60a5fa;
    --accent-dark: #3b82f6;
    --border: #1f2937;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --fade-bg: rgba(11, 15, 26, 0);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px;
}

.main {
  padding-bottom: 64px;
}

.text-center {
    text-align: center;
}

.lead {
    font-weight: 400;
    font-size: 1.25em;
}

.lead:not(:last-child) {
    margin-bottom: 1.36842105263158em;
}

.site-header {
  padding: 24px 0;
}

.page-content-header {
    height: 160px;
    padding: 56px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-picture {
  display: flex;
  align-items: center;
}

.logo-img {
  width: 50px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.nav a {
  margin-left: 20px;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav a:first-child {
  margin-left: 0;
}

.nav a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 2px 0;
  border-radius: 999px;
  background: currentColor;
}

.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 4px solid var(--card);
  box-shadow: var(--shadow);
  background: var(--card);
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

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

.hero-body {
  max-width: 640px;
  color: var(--muted);
}

.works-header-bar {
  margin: 48px 0 24px;
}

.works-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.section-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: 66px;
}

.work-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
}

@media (prefers-color-scheme: dark) {
  .work-card:hover {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    border-color: rgba(96, 165, 250, 0.35);
  }
}

.work-card-inner {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.work-media {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
  min-height: 280px;
}

.media-frame {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover .media-frame img {
  transform: scale(1.05);
}

.work-info {
  flex: 1.25;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.app-store-header {
  display: flex;
  align-items: top;
  gap: 16px;
}

.app-icon {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  background: var(--card);
  object-fit: cover;
  flex-shrink: 0;
}

.app-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.app-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.app-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}

.work-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .tech-tag {
    background: rgba(255, 255, 255, 0.06);
  }
}

.work-cta {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.primary-cta {
  gap: 8px;
}

.cta-arrow {
  transition: transform 0.2s ease;
}

.primary-cta:hover .cta-arrow {
  transform: translateX(4px);
}



.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  background: var(--accent-dark);
  color: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.3);
}

.button.secondary:hover {
  background: rgba(37, 99, 235, 0.08);
}

.page {
  padding: 48px 0;
}

.page-header {
  margin-bottom: 18px;
}

.page-header h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--muted);
}

.page-content {
  color: var(--muted);
}

.page-content a {
  color: var(--accent);
}

.work-hero {
  padding: 48px 0 28px;
}

.work-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-title {
  display: flex;
  align-items: center;
  gap: 18px;
}

.work-icon {
  width: 168px;
  height: 168px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 8px;
}

.work-short {
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 10px;
}

.work-details {
  padding: 0 0 32px;
}

.work-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.meta-item {
  background: transparent;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.meta-item span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.meta-item strong {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

.work-title .button {
  margin-top: 4px;
}

.work-body {
  padding: 0 0 48px;
}

.work-gallery {
  margin-bottom: 24px;
}

.work-gallery-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.work-gallery-item {
  flex: 0 0 auto;
  width: clamp(200px, 28vw, 280px);
  scroll-snap-align: start;
}

.work-gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 32px;
}

.work-gallery--landscape .work-gallery-item {
  width: auto;
  height: 400px;
}

.work-gallery--landscape .work-gallery-item img {
  width: auto;
  height: 100%;
  max-width: none;
}

.work-hero-image {
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  background: var(--card);
}

.work-content {
  color: var(--muted);
  display: grid;
  gap: 12px;
}

.work-content ul {
  padding-left: 20px;
}

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 840px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .js .nav-toggle {
    display: inline-flex;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }

  .js .nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.2s ease, padding 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
  }

  .js .nav.is-open {
    max-height: 240px;
    padding-top: 16px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .work-gallery--landscape .work-gallery-item {
    height: 280px;
  }

  .work-card-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .work-media {
    height: 240px;
    min-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .work-info {
    padding: 24px;
  }

  .work-card {
    padding: 0;
  }

  .work-cta {
    justify-content: flex-start;
  }

  .app-store-header {
    flex-wrap: wrap;
  }

  .nav a,
  .nav a:first-child {
    margin-left: 0;
    padding: 8px 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .work-title {
    flex-direction: column;
    align-items: flex-start;
  }
}

.page-content pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

code, pre code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

:not(pre) > code, .page-content :not(pre) > code {
  font-size: 0.88em;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :not(pre) > code, .page-content :not(pre) > code {
    background: rgba(248, 250, 252, 0.08);
    border-color: rgba(248, 250, 252, 0.12);
  }
}

/* Syntax Highlighting Tokens (Xcode Light Inspired) */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt,
.hljs-keyword, .hljs-literal { color: #ad3da4; font-weight: 600; }

.highlight .nc, .highlight .nn,
.hljs-type, .hljs-class, .hljs-title.class_ { color: #0f68a0; font-weight: 600; }

.highlight .nf, .highlight .fm,
.hljs-title.function_, .hljs-function { color: #007a78; }

.highlight .s, .highlight .s1, .highlight .s2, .highlight .se, .highlight .sh,
.hljs-string { color: #c41a16; }

.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo,
.hljs-number { color: #1c00cf; }

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs,
.hljs-comment { color: #5d6c79; font-style: italic; }

.highlight .o, .highlight .ow,
.hljs-operator { color: #3f4c5a; }

.highlight .p,
.hljs-punctuation { color: var(--text); }

.highlight .nd, .highlight .na,
.hljs-meta, .hljs-attribute { color: #a15c00; }

.highlight .nb, .highlight .bp,
.hljs-built_in, .hljs-symbol { color: #6f42c1; }

/* Syntax Highlighting Tokens (Xcode Dark Inspired) */
@media (prefers-color-scheme: dark) {
  .highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt,
  .hljs-keyword, .hljs-literal { color: #fc5fa3; }

  .highlight .nc, .highlight .nn,
  .hljs-type, .hljs-class, .hljs-title.class_ { color: #5dd8f6; }

  .highlight .nf, .highlight .fm,
  .hljs-title.function_, .hljs-function { color: #a3d900; }

  .highlight .s, .highlight .s1, .highlight .s2, .highlight .se, .highlight .sh,
  .hljs-string { color: #fc6a5d; }

  .highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo,
  .hljs-number { color: #d0bf69; }

  .highlight .c, .highlight .c1, .highlight .cm, .highlight .cs,
  .hljs-comment { color: #6c7986; }

  .highlight .o, .highlight .ow,
  .hljs-operator { color: #d5d8da; }

  .highlight .p,
  .hljs-punctuation { color: var(--text); }

  .highlight .nd, .highlight .na,
  .hljs-meta, .hljs-attribute { color: #e5c07b; }

  .highlight .nb, .highlight .bp,
  .hljs-built_in, .hljs-symbol { color: #b392f0; }
}

.page-content ol {
    padding-left: 24px;
    margin: 1em 0;
}

table {
    width: 100%;
    border-collapse: separate;
}

table th {
    background: #fafafa;
    color: var(--text);
}

table tr, table td, table th {
    border-top: none;
    border-left: none;
    border-right: none;
}

table th, table td {
    padding: 0.92857143em;
}

.page-content table tbody tr td code {
    border: none;
    background: none;
}

table.border--round {
    border-radius: 6px;
    border: 1px solid #ececec;
}

table caption {
    font-size: 0.9em;
    margin-left: 10px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    color: var(--muted);
    text-align: left;
    caption-side: bottom;
}

.page-content h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 32px 0 12px;
  font-weight: 500;
}

.page-content h3, .page-content h4, .page-content h5 {
  color: var(--text);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 24px 0 10px;
}

.page-content p {
  margin-bottom: 16px;
}

h2 {
    margin-bottom: 0.78787878787879em;
}

p {
    margin-bottom: 1.85714286em;
}

.toc {
  padding-left: 24px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc li {
  line-height: 1.5;
}

.toc a {
  color: var(--accent);
}

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

@media (prefers-color-scheme: dark) {
    table th {
        background: rgba(248, 250, 252, 0.04);
    }

    
    table.border--round {
        border-radius: 6px;
        border: 1px solid rgba(248, 250, 252, 0.12);
    }
}
