:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5f6b7a;
  --line: #d9e0e7;
  --accent: #1f5eff;
  --accent-dark: #1645b8;
  --soft-accent: #eaf0ff;
  --success: #1f8f55;
  --shadow: 0 12px 30px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(31, 94, 255, 0.28);
  outline-offset: 3px;
}

.container {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  background:
    linear-gradient(135deg, rgba(31, 94, 255, 0.10), rgba(255, 255, 255, 0.85)),
    var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 72px 0;
}

.header-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 36px;
  align-items: center;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-line .eyebrow {
  margin-bottom: 0;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(23, 32, 42, 0.06);
}

.lang-button {
  border: 0;
  border-radius: 999px;
  padding: 6px 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.lang-button:hover {
  color: var(--text);
  background: var(--soft-accent);
}

.lang-button.active {
  color: white;
  background: var(--accent);
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 6vw, 66px);
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
}

.two-column h2 {
  font-size: clamp(24px, 2.6vw, 32px);
}

h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

p {
  margin-top: 0;
}

.lead {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.button.secondary {
  background: white;
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.profile-card,
.card,
.project-main,
.status-card,
.background-card,
.contact-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.profile-card {
  padding: 26px;
}

.profile-card h2 {
  font-size: 20px;
  margin-bottom: 18px;
}

.profile-card dl {
  margin: 0;
}

.profile-card div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.profile-card div:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-card dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-card dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.section {
  padding: 64px 0;
}

.section.muted {
  background: #eef2f6;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#contact {
  padding: 44px 0;
}

#contact .container {
  max-width: 760px;
}

.two-column {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 46px;
}

.two-column p:last-child {
  margin-bottom: 0;
}

.section-intro {
  max-width: 780px;
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 17px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card {
  padding: 24px;
}

.card p,
.project-main p,
.status-card p,
.background-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.project-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 22px;
}

.project-main,
.status-card {
  padding: 28px;
}

.check-list,
.plain-list {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.check-list li,
.plain-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 13px;
}

.check-list li:last-child,
.plain-list li:last-child {
  margin-bottom: 0;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 900;
}

.plain-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
  font-weight: 900;
}

.timeline {
  margin: 0;
  padding-left: 22px;
}

.timeline li {
  margin-bottom: 10px;
  color: var(--muted);
}

.timeline li.done {
  color: var(--text);
  font-weight: 700;
}

.timeline li.done::marker {
  color: var(--success);
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.skill-list div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.skill-list p {
  color: var(--muted);
  margin: 0;
}

.background-card {
  padding: 26px;
  margin-bottom: 18px;
}

.background-card:last-child {
  margin-bottom: 0;
}

.contact-panel {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.contact-panel h2 {
  margin-bottom: 0;
}

.contact-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 60ch;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.contact-links a {
  background: var(--soft-accent);
  border: 1px solid #c7d5ff;
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}

.contact-links a:hover {
  background: #dfe8ff;
  text-decoration: none;
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.footer-counter {
  margin-left: 0.75rem;
  white-space: nowrap;
}

.footer-separator {
  opacity: 0.5;
  margin: 0 0.35rem;
}

@media (max-width: 860px) {
  .header-grid,
  .two-column,
  .project-layout,
  .card-grid,
  .skill-list {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding: 44px 0;
  }

}

@media (max-width: 520px) {
  .container {
    width: min(100% - 28px, 1080px);
  }

  h1 {
    font-size: clamp(38px, 13vw, 52px);
  }

  .lead {
    font-size: 17px;
  }

  .button {
    width: 100%;
    text-align: center;
  }

  .language-switch {
    margin-top: 2px;
  }
}

.badge-link {
    display: inline-flex;
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    align-self: flex-start;
}

.badge-link:hover {
    text-decoration: underline;
}

/* Project detail pages */

.project-detail-hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

.project-detail-hero h1 {
  margin-bottom: 1rem;
}

.project-lead {
  max-width: 760px;
  font-size: 1.1rem;
  line-height: 1.7;
}

.project-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.project-summary-grid {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
}

.summary-card h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.project-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.project-section h2 {
  margin-bottom: 0.75rem;
}

.project-section p,
.project-section li {
  line-height: 1.7;
}

.project-section ul {
  padding-left: 1.25rem;
}

@media (max-width: 700px) {
  .project-summary-grid {
    grid-template-columns: 1fr;
  }

  .project-detail-hero {
    padding-top: 3rem;
  }
}

.project-diagram {
  width: 100%;
  max-width: 1100px;
  display: block;
  margin: 2rem auto 0;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.project-links a {
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

.section-bordered {
  border-top: 1px solid var(--line);
}

/* Live demo panel (project detail pages) */
.workflow-demo-panel {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0 16px;
}

.workflow-demo-button {
  display: inline-block;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  line-height: 1.7;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

.workflow-demo-button:hover {
  background: var(--accent-dark);
}

.workflow-demo-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.workflow-demo-result {
  width: min(100%, 26rem);
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.workflow-demo-result p {
  margin: 6px 0;
  font-size: 15px;
  color: var(--muted);
}

.demo-result-strong {
  color: var(--text);
  font-weight: 800;
}

.demo-result-error {
  color: #b3261e;
  font-weight: 700;
}

@media (max-width: 720px) {
  .workflow-demo-panel {
    display: block;
  }

  .workflow-demo-button,
  .workflow-demo-result {
    width: 100%;
  }

  .workflow-demo-result {
    margin-top: 14px;
  }
}


/* Project detail body copy */
.project-copy-text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 980px;
}

.project-copy-text + .project-copy-text {
  margin-top: 1.35rem;
}
