/* IOS Lab – public site */

:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #686868;
    --border: #e4e4e4;
    --soft: #f6f6f3;
    --success-bg: #ecf8ef;
    --success-text: #1d6b32;
    --error-bg: #fdecec;
    --error-text: #a12121;
    --narrow: 720px;
    --wide: 1200px;
    --gutter: clamp(16px, 4vw, 48px);
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.125rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--text); color: var(--bg); padding: 8px 16px; z-index: 10; }
.skip-link:focus { left: 16px; top: 16px; }

/* Header */
.site-header { position: relative; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 24px; padding-bottom: 24px; }
.site-title { font-weight: 700; font-size: 1.125rem; text-decoration: none; letter-spacing: -0.02em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-nav a { text-decoration: none; font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }
.nav-toggle { display: none; background: none; border: 0; padding: 4px; color: inherit; cursor: pointer; }
.nav-toggle svg { fill: currentColor; display: block; }

@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 24px; z-index: 5; }
    .site-nav.is-open { display: block; }
    .site-nav ul { flex-direction: column; gap: 16px; }
    .site-nav a { font-size: 1.25rem; }
}

/* Main */
.site-main { flex: 1; padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); }

.page-title { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 32px; }

.prose { overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; margin: 2em 0 0.5em; }
.prose h3 { font-size: 1.2rem; font-weight: 600; line-height: 1.3; margin: 1.75em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 0.35em; }
.prose img { margin: 1.5em 0; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.25em; border-left: 3px solid var(--text); }
.prose table { border-collapse: collapse; width: 100%; margin: 1.5em 0; }
.prose td, .prose th { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }

.home-intro { margin-bottom: 24px; color: var(--muted); }

/* Post list on the homepage */
.post-card { padding: clamp(32px, 6vw, 64px) 0; border-top: 1px solid var(--border); }
.post-card:first-of-type { border-top: 0; padding-top: 0; }
.post-image { display: block; margin: 0 0 28px; }
.post-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
figure.post-image { margin: 0 0 40px; }
.post-title { font-size: clamp(1.75rem, 3.5vw, 2.4rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 24px; }
.post-title a { text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-date { font-size: 0.9rem; color: var(--muted); margin: 24px 0 0; }
.page-title + .post-date { margin: -16px 0 32px; }
.post-date a { text-decoration: none; }
.post-date a:hover { text-decoration: underline; }

.draft-notice { background: #fff6d6; border: 1px solid #f0dc8c; padding: 10px 14px; font-size: 0.95rem; margin: 0 0 24px; }

/* Contact form */
.contact-form { margin-top: 32px; }
.contact-form p { margin: 0 0 20px; }
.contact-form label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%; font: inherit; font-size: 1rem; color: inherit; background: var(--bg);
    border: 1px solid #c9c9c9; border-radius: 0; padding: 12px 14px;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--text); outline-offset: 0; border-color: var(--text); }
.contact-form textarea { resize: vertical; min-height: 160px; }
.field-error { display: block; color: var(--error-text); font-size: 0.9rem; margin-top: 6px; }
.form-notice { padding: 12px 16px; font-size: 1rem; }
.form-notice--success { background: var(--success-bg); color: var(--success-text); }
.form-notice--error { background: var(--error-bg); color: var(--error-text); }

.button {
    display: inline-block; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
    background: var(--text); color: var(--bg); border: 1px solid var(--text); padding: 12px 28px; text-decoration: none;
}
.button:hover { background: #333; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 40px; font-size: 0.95rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.footer-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.footer-tagline { margin: 4px 0 0; color: var(--muted); }
.footer-text { margin: 0; color: var(--muted); }
