/* ==========================================================================
   NetTools — トップページ スタイル
   Palette:
     --bg        #F6F7F3  base background
     --surface   #FFFFFF  card surface
     --ink       #17241D  primary text
     --ink-soft  #57655D  secondary text
     --line      #DCE1D8  hairline / borders
     --teal      #1F6F54  primary accent (signal / circuit)
     --blue      #2C4E7C  secondary accent (data / network)
   ========================================================================== */

:root {
  --bg: #F6F7F3;
  --surface: #FFFFFF;
  --ink: #17241D;
  --ink-soft: #57655D;
  --line: #DCE1D8;
  --teal: #1F6F54;
  --teal-soft: #E6F0EB;
  --blue: #2C4E7C;
  --blue-soft: #E9EEF5;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: relative;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 24px;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  color: var(--teal);
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.logo-mark {
  color: var(--teal);
  font-family: var(--font-mono);
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--teal);
}

.site-nav a.is-active {
  color: var(--teal);
  font-weight: 500;
}

.site-nav a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- hero ---------- */

.hero {
  padding: 96px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin: 0 0 16px;
  text-transform: lowercase;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 42px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.hero-lead {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0;
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}

.hero-panel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}

.hero-ip {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
  word-break: break-all;
}

.hero-ip-type {
  font-size: 12px;
  color: var(--teal);
  margin: 0 0 20px;
}

.hero-panel-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.hero-panel-key {
  color: var(--ink-soft);
}

.hero-panel-val {
  font-family: var(--font-mono);
  color: var(--ink);
  text-align: right;
}

.dots::after {
  content: '';
  display: inline-block;
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.hero-panel-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
}

.hero-panel-link:hover { text-decoration: underline; }

/* ---------- route divider (signature element) ---------- */

.route-divider {
  display: flex;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 40px;
}

.route-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--line) 0,
    var(--line) 4px,
    transparent 4px,
    transparent 9px
  );
}

.route-node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin: 0 -1px;
}

/* ---------- tools ---------- */

.tools {
  padding: 56px 0 96px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 32px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  display: block;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tool-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.tool-card:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.tool-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  display: block;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 8px;
}

.tool-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

/* ---------- security headers page ---------- */

.score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.score-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  margin: 4px 0 0;
}

.score-total {
  font-size: 18px;
  color: var(--ink-soft);
}

.score-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
}

.score-good {
  background: var(--teal-soft);
  color: var(--teal);
}

.score-mid {
  background: #FDF3E3;
  color: #8A5A0B;
}

.score-bad {
  background: #FBEAEA;
  color: #7A2626;
}

.score-info {
  background: var(--blue-soft);
  color: var(--blue);
}

.score-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-left: auto;
  text-align: right;
}

.check-row {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.check-row-body {
  flex: 1;
  min-width: 0;
}

.check-row:first-of-type {
  border-top: none;
}

.check-icon-ok {
  color: var(--teal);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.check-icon-ng {
  color: #B44444;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.check-row-label {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  margin: 0 0 4px;
}

.check-row-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

.check-status {
  font-weight: 500;
}

.check-status-ok {
  color: var(--teal);
}

.check-status-ng {
  color: #B44444;
  font-weight: 600;
}

.check-row-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 8px 0 0;
  word-break: break-all;
}

@media (max-width: 560px) {
  .score-meta {
    margin-left: 0;
    text-align: left;
  }
}

/* ---------- status / redirect check page ---------- */

.hop-chain {
  display: flex;
  flex-direction: column;
}

.hop-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.hop-row:first-of-type {
  border-top: none;
}

.hop-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

.hop-badge-2xx {
  background: var(--teal-soft);
  color: var(--teal);
}

.hop-badge-3xx {
  background: var(--blue-soft);
  color: var(--blue);
}

.hop-badge-4xx {
  background: #FDF3E3;
  color: #8A5A0B;
}

.hop-badge-5xx {
  background: #FBEAEA;
  color: #7A2626;
}

.hop-body {
  flex: 1;
  min-width: 0;
}

.hop-url {
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
  margin: 0 0 4px;
}

.hop-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.hop-arrow {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 0 0;
  word-break: break-all;
}

.dns-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.dns-table th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
}

.dns-table td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  word-break: break-all;
}

.dns-table tr:last-child td {
  border-bottom: none;
}

.dns-table th:last-child,
.dns-table td:last-child {
  width: 72px;
}

.dns-table-mono {
  font-family: var(--font-mono);
}

.dns-table-value {
  color: var(--ink);
  line-height: 1.6;
}

@media (max-width: 700px) {
  .dns-table {
    font-size: 12px;
  }
  .dns-table th:last-child,
  .dns-table td:last-child {
    width: 56px;
  }
}

/* ---------- tool form (whois / dns など共通) ---------- */

.tool-form {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.tool-form input[type="text"] {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.4;
}

.tool-form input[type="text"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.tool-form button {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 10px;
  padding: 0 32px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.tool-form button:hover { opacity: 0.9; }

.tool-alert {
  background: #FBEAEA;
  color: #7A2626;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13.5px;
  margin-bottom: 24px;
}

.raw-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-top: 16px;
}

.raw-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.raw-card-server {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.raw-output {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.related-links {
  margin-top: 20px;
}

.related-link {
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
}

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

@media (max-width: 560px) {
  .tool-form {
    flex-direction: column;
  }
  .tool-form button {
    padding: 16px 32px;
  }
}

/* ---------- page hero (個別ツールページ共通) ---------- */

.page-hero {
  padding: 72px 0 24px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.page-lead {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
}

/* ---------- detail / myip page ---------- */

.detail {
  padding: 40px 0 120px;
}

.ip-display {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 24px;
}

.ip-display-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.ip-display-value {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 500;
  margin: 0;
  word-break: break-all;
}

.ip-display-type {
  font-size: 12px;
  color: var(--teal);
  margin: 8px 0 0;
}

.copy-btn {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.copy-btn:hover { opacity: 0.8; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}

.info-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.info-row:first-of-type {
  border-top: none;
}

.info-row-stack {
  flex-direction: column;
  gap: 4px;
}

.info-key {
  color: var(--ink-soft);
  flex-shrink: 0;
}

.info-val {
  color: var(--ink);
  text-align: right;
}

.info-row-stack .info-val {
  text-align: left;
}

.info-val-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.info-val-small {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  word-break: break-all;
}

.info-empty {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

.info-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 20px 0 0;
}

@media (max-width: 700px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  .ip-display-value {
    font-size: 26px;
  }
}

/* ---------- knowledge / FAQ (技術解説セクション) ---------- */

.knowledge {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.knowledge-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}

.knowledge-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.knowledge-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.knowledge-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.knowledge-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.knowledge-block-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
  padding-left: 12px;
  position: relative;
}

.knowledge-block-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--teal);
}

.knowledge-block p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}

.knowledge-block ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.knowledge-block code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.faq-q,
.faq-a {
  display: flex;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
}

.faq-q {
  font-weight: 600;
  color: var(--ink);
}

.faq-a {
  margin-top: 8px;
  color: var(--ink-soft);
}

.faq-tag {
  flex-shrink: 0;
  width: 18px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.faq-q .faq-tag {
  color: var(--teal);
}

.faq-a .faq-tag {
  color: var(--blue);
}

/* ---------- footer ---------- */

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

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 12px;
  color: var(--ink-soft);
}

.footer-brand p {
  margin: 0 0 4px;
}
.footer-brand p:last-child {
  margin-bottom: 0;
}

.site-footer-note {
  font-family: var(--font-mono);
}

/* 中央: 赤猫座ボタン */
.footer-center .footer-btn {
  display: inline-block;
  font-weight: 600;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.footer-center .footer-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

/* 右側: 2行のリンク */
.footer-right {
  text-align: right;
}

.footer-right-link {
  margin-bottom: 4px;
}
.footer-right-link:last-child {
  margin-bottom: 0;
}

.footer-right-link a {
  color: var(--blue);
  text-decoration: underline;
}

.footer-right-link a:hover {
  color: var(--teal);
}

.footer-right-link.footer-sub-link {
  font-size: 11px;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-copy h1 {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .site-footer .wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }
  .footer-right {
    text-align: center;
  }
}

@media (max-width: 560px) {
  .menu-toggle {
    display: flex;
  }
  .site-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  }
  .site-nav.is-open {
    max-height: 400px;
    padding: 8px 24px 16px;
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }
  .site-nav a:last-child {
    border-bottom: none;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 56px 0 40px;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .dots::after {
    animation: none;
    transition: none;
  }
}
