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

/* Root Variables */
:root {
  --color-bg: #fafafa;
  --color-text: #333;
  --color-text-muted: #666;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-border: #e5e7eb;
  --color-code-bg: #f3f4f6;
  --color-blockquote-border: #d1d5db;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 1200px;
  --content-width: 720px;
  --spacing: 1.5rem;
  --container-padding: 1.5rem;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  width: 100%;
}

/* Typography */
html {
  font-size: 16px;
  line-height: 1.7;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

li > ul,
li > ol {
  margin-bottom: 0;
  margin-top: 0.25rem;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

pre {
  background-color: var(--color-code-bg);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--color-blockquote-border);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  text-align: left;
}

th {
  background-color: var(--color-code-bg);
  font-weight: 600;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

figure {
  margin-bottom: 1rem;
}

figcaption {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Layout */
header {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  text-align: center;
}

.site-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-title:hover {
  color: var(--color-primary);
  text-decoration: none;
}

main {
  flex: 1;
  padding: var(--spacing) 0;
}

#content {
  max-width: var(--content-width);
}

#content h1:first-child {
  margin-top: 0;
}

/* プロフィールページでは content の幅制限を解除 */
#content:has(.profile) {
  max-width: none;
}

/* 全画面レイアウト（none.html） */
.layout-none {
  min-height: 100vh;
}

.layout-none main {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.layout-none #content {
  max-width: none;
  width: 100%;
  height: 100%;
}

footer {
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.copyright {
  margin: 0;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-links a {
  color: var(--color-text-muted);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
}

.social-links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* Form Elements */
input,
textarea,
button {
  font-family: inherit;
  font-size: 1rem;
}

input,
textarea {
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 500;
}

button:hover {
  background-color: var(--color-primary-hover);
}

/* Profile */
.profile {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.profile-header {
  text-align: center;
  margin-bottom: 2rem;
}

.profile-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  box-shadow: 
    0 0 0 4px var(--color-bg),
    0 0 0 6px var(--color-border),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--color-text);
}

.profile-id {
  font-size: 0.75rem;
  font-weight: 400;
  color: #aaa;
  margin: 0 0 0.5rem 0;
}

.profile-job {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
}

.profile-section {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.profile-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem 0;
  padding-left: 0.5rem;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--color-code-bg);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-text);
}

.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-list li {
  padding: 0.375rem 0;
  font-size: 0.9375rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.profile-list li:last-child {
  border-bottom: none;
}

.profile-links {
  display: flex;
  gap: 0.75rem;
}

.profile-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--color-code-bg);
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
}

.profile-link-icon:hover {
  background-color: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 640px) {
  :root {
    --container-padding: 2rem;
  }

  html {
    font-size: 15px;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
  h3 { font-size: 1.125rem; }

  header {
    padding: 0.75rem 0;
  }

  .site-title {
    font-size: 1rem;
  }

  footer {
    padding: 0.75rem 0;
  }

  .profile {
    padding: 0 2rem;
  }

  .profile-icon {
    width: 100px;
    height: 100px;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .profile-id {
    font-size: 0.6875rem;
  }

  .profile-header {
    margin-bottom: 1.5rem;
  }

  .profile-section {
    margin-bottom: 1.25rem;
  }
}
