/* SharpAngle – Tool Sharpening Angle Finder styles */

:root {
  --c-bg: #FFF7ED;
  --c-surface: #FFFFFF;
  --c-surface-alt: #FEF3C7;
  --c-primary: #B45309;
  --c-primary-dark: #78350F;
  --c-primary-light: #F59E0B;
  --c-text: #1C1917;
  --c-text-secondary: #57534E;
  --c-text-muted: #78716C;
  --c-border: #E7E5E4;
  --c-border-dark: #A8A29E;
  --c-success: #15803D;
  --c-focus: #D97706;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4rem; }

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

a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--c-primary-dark); }

/* Header */
.site-header {
  background: var(--c-primary-dark);
  color: #FFF7ED;
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #FFF7ED;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.logo:hover { color: #FDE68A; text-decoration: none; }
.logo svg { flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 1.25rem;
}
.main-nav a {
  color: #FDE68A;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color .15s;
}
.main-nav a:hover,
.main-nav a:focus {
  color: #FFF7ED;
  border-bottom-color: #FDE68A;
  text-decoration: none;
}

/* Main */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  width: 100%;
}

/* Finder section */
.finder-section {
  margin-bottom: 3rem;
}
.finder-header {
  text-align: center;
  margin-bottom: 2rem;
}
.finder-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--c-primary-dark);
  margin-bottom: .5rem;
}
.finder-sub {
  color: var(--c-text-secondary);
  font-size: 1.1rem;
}

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Tool picker */
.tool-picker {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.tool-picker h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--c-primary-dark);
}
.category-group {
  margin-bottom: 1rem;
}
.category-group h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--c-text-muted);
  margin-bottom: .4rem;
}
.tool-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-text);
  font-size: .9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tool-btn:hover {
  background: var(--c-surface-alt);
}
.tool-btn.active {
  background: var(--c-primary);
  color: #FFF7ED;
  border-color: var(--c-primary-dark);
}
.tool-btn:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

.steel-picker {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}
.steel-picker label {
  display: block;
  font-size: .85rem;
  color: var(--c-text-secondary);
  margin-bottom: .35rem;
}
.steel-picker select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--c-border-dark);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .9rem;
  background: var(--c-bg);
  color: var(--c-text);
}

/* Result panel */
.result-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  min-height: 300px;
}
.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 250px;
  color: var(--c-text-muted);
  text-align: center;
  gap: 1rem;
}
.result-content h2 {
  font-size: 1.25rem;
  color: var(--c-primary-dark);
  margin-bottom: .25rem;
}
.result-tool-name {
  font-weight: 700;
}
.result-angle-display {
  font-size: 3rem;
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1.1;
  margin: .5rem 0;
}
.result-angle-label {
  font-size: .9rem;
  color: var(--c-text-secondary);
  margin-bottom: 1rem;
}
.result-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}
.result-detail-grid .detail-item {
  background: var(--c-surface-alt);
  padding: .75rem;
  border-radius: var(--radius);
}
.result-detail-grid .detail-label {
  font-size: .75rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .2rem;
}
.result-detail-grid .detail-value {
  font-weight: 600;
  font-size: 1rem;
}
.result-tips {
  background: #FEF3C7;
  border-left: 3px solid var(--c-primary);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 1rem;
  font-size: .9rem;
}
.result-tips h3 {
  font-size: .85rem;
  margin-bottom: .35rem;
  color: var(--c-primary-dark);
}
.result-tips ul {
  padding-left: 1.1rem;
}
.result-tips li + li {
  margin-top: .25rem;
}

/* Bevel diagram */
.bevel-diagram {
  margin: 1rem 0;
  text-align: center;
}
.bevel-diagram svg {
  max-width: 280px;
  height: auto;
}

/* Result actions */
.result-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.btn-action {
  padding: .5rem 1rem;
  border: 1px solid var(--c-primary);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-primary);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn-action:hover {
  background: var(--c-surface-alt);
}
.btn-action:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

/* Section headers */
.section-header {
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-size: 1.5rem;
  color: var(--c-primary-dark);
  margin-bottom: .35rem;
}
.section-header p {
  color: var(--c-text-secondary);
}

/* Comparison section */
.comparison-section {
  margin-bottom: 3rem;
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.angle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--c-surface);
}
.angle-table th {
  background: var(--c-primary-dark);
  color: #FFF7ED;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.angle-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--c-border);
}
.angle-table tbody tr:nth-child(even) {
  background: #FFFBEB;
}
.angle-table tbody tr:hover {
  background: #FEF3C7;
}

/* Mistakes section */
.mistakes-section {
  margin-bottom: 3rem;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.tip-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.tip-card h3 {
  font-size: 1rem;
  color: var(--c-primary-dark);
  margin-bottom: .5rem;
}
.tip-card p {
  font-size: .9rem;
  color: var(--c-text-secondary);
}

/* Jigs section */
.jigs-section {
  margin-bottom: 3rem;
}
.jig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.jig-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.jig-card h3 {
  font-size: 1rem;
  color: var(--c-primary-dark);
  margin-bottom: .5rem;
}
.jig-card p {
  font-size: .88rem;
  color: var(--c-text-secondary);
}

/* Steel section */
.steel-section {
  margin-bottom: 3rem;
}
.steel-intro {
  color: var(--c-text-secondary);
  margin-bottom: 1rem;
}
.steel-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.steel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--c-surface);
}
.steel-table th {
  background: #44403C;
  color: #FFF7ED;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
}
.steel-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--c-border);
}
.steel-table tbody tr:nth-child(even) {
  background: #FAFAF9;
}

/* Print section */
.print-section {
  margin-bottom: 3rem;
}

/* Footer */
.site-footer {
  background: #292524;
  color: #D6D3D1;
  padding: 2rem 0;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: #FDE68A;
  text-decoration: none;
  font-size: .85rem;
}
.footer-links a:hover {
  text-decoration: underline;
}
.footer-note {
  font-size: .8rem;
  color: #A8A29E;
  margin-top: .5rem;
}

/* Print styles */
@media print {
  .site-header, .site-footer, .tool-picker, .steel-picker, .result-actions, .finder-header p {
    display: none !important;
  }
  body { background: white; }
  .result-panel { box-shadow: none; border: none; }
  .comparison-section, .mistakes-section, .jigs-section, .steel-section { break-inside: avoid; }
  .angle-table th { background: #333 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Responsive */
@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .tool-picker { order: 1; }
  .result-panel { order: 2; }
  .header-inner { flex-direction: column; gap: .5rem; }
  .main-nav { flex-wrap: wrap; justify-content: center; }
  .result-detail-grid { grid-template-columns: 1fr; }
  .finder-header h1 { font-size: 1.5rem; }
  .result-angle-display { font-size: 2.5rem; }
}

@media (max-width: 480px) {
  main { padding: 1rem .75rem 2rem; }
  .tool-picker, .result-panel { padding: 1rem; }
  .site-header { padding: .5rem 0; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
