/* === Custom Properties === */
:root {
  --color-text: #1a1a1a;
  --color-text-muted: #666;
  --color-bg: #fafaf8;
  --color-border: #e0e0e0;
  --color-link: #1a1a1a;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 4rem;
  --space-xl: 6rem;
}

/* === Reset === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Base === */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  padding: var(--space-m) var(--space-m);
}

/* === Typography === */
h1, h2, h3 {
  font-weight: 500;
  line-height: 1.2;
}

h1 { font-size: 1.5rem; margin-bottom: var(--space-s); }
h2 { font-size: 1rem; margin-bottom: var(--space-xs); }

p { margin-bottom: var(--space-s); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration: none;
}

/* === Header === */
.site-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--color-border);
}

.site-name {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

/* === Footer === */
.site-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-s);
  border-top: 1px solid var(--color-border);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* === Main === */
main {
  min-height: 60vh;
}

/* === Home intro === */
.home-intro {
  max-width: 48rem;
  margin-bottom: var(--space-xl);
}

.home-intro p {
  font-size: 1.125rem;
  line-height: 1.7;
}

/* === Home sections === */
.home-section {
  margin-bottom: var(--space-xl);
}

/* === Section heading === */
.section-heading {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-m);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* === Works table === */
.table-wrap {
  overflow-x: auto;
}

.works-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.works-table th {
  text-align: left;
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-xs) var(--space-s) var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.works-table td {
  padding: var(--space-s) var(--space-s) var(--space-s) 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.works-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.015);
}

.works-table .col-year {
  white-space: nowrap;
  text-align: right;
  padding-right: 0;
}

.works-table .col-category {
  white-space: nowrap;
}

.works-table .ja {
  display: block;
  margin-top: 0.15em;
}

/* === About grid === */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-l);
}

/* === Bilingual === */
.ja {
  font-size: 0.85em;
  color: var(--color-text-muted);
}

.home-intro .ja {
  font-size: 0.95rem;
}

/* === 404 === */
.not-found {
  text-align: center;
  padding: var(--space-xl) 0;
}

/* === Responsive === */
@media (max-width: 768px) {
  body {
    padding: var(--space-s) var(--space-s);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-m);
  }

  .works-table .col-category,
  .works-table th:nth-child(4),
  .works-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 480px) {
  .works-table td,
  .works-table th {
    padding: var(--space-xs) var(--space-xs) var(--space-xs) 0;
    font-size: 0.8125rem;
  }
}
